diff --git a/lib/ddtrace/workers/async.rb b/lib/ddtrace/workers/async.rb index 7d15c175ab..4189bc3bab 100644 --- a/lib/ddtrace/workers/async.rb +++ b/lib/ddtrace/workers/async.rb @@ -42,7 +42,7 @@ def terminate end def run_async? - @run_async = false unless instance_variable_defined?(:@run_async) + return false unless instance_variable_defined?(:@run_async) @run_async == true end @@ -55,7 +55,7 @@ def running? end def error? - @error = nil unless instance_variable_defined?(:@error) + return false unless instance_variable_defined?(:@error) !@error.nil? end diff --git a/lib/ddtrace/workers/loop.rb b/lib/ddtrace/workers/loop.rb index 3720521bdd..347e7fea4f 100644 --- a/lib/ddtrace/workers/loop.rb +++ b/lib/ddtrace/workers/loop.rb @@ -33,7 +33,7 @@ def work_pending? end def run_loop? - @run_loop = false unless instance_variable_defined?(:@run_loop) + return false unless instance_variable_defined?(:@run_loop) @run_loop == true end diff --git a/lib/ddtrace/workers/polling.rb b/lib/ddtrace/workers/polling.rb index 1ab206db71..6b22000c09 100644 --- a/lib/ddtrace/workers/polling.rb +++ b/lib/ddtrace/workers/polling.rb @@ -34,7 +34,7 @@ def stop(force_stop = false, timeout = SHUTDOWN_TIMEOUT) end def enabled? - @enabled = true unless instance_variable_defined?(:@enabled) + return true unless instance_variable_defined?(:@enabled) @enabled end