Skip to content

Commit

Permalink
revert worker change
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Nov 4, 2024
1 parent e86694a commit c930fca
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/datadog/core/workers/polling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ def perform(*args)
end
end

# Stops the worker thread.
#
# Signals the worker loop to stop and waits up to the timeout value
# (in seconds) for the thread to end.
# Then, if force_stop is true, terminates the thread by calling
# Thread#terminate.
#
# Returns true if the thread was terminated, false if the
# thread continues to run.
def stop(force_stop = false, timeout = DEFAULT_SHUTDOWN_TIMEOUT)
if running?
# Attempt graceful stop and wait
Expand All @@ -43,9 +34,12 @@ def stop(force_stop = false, timeout = DEFAULT_SHUTDOWN_TIMEOUT)
"Timeout while waiting for worker to finish gracefully, forcing termination for: #{self}"
end
terminate
else
graceful
end
else
false
end
!running?
end

def enabled?
Expand Down

0 comments on commit c930fca

Please sign in to comment.