Skip to content

Commit

Permalink
Remove allow_restart argument
Browse files Browse the repository at this point in the history
I initially added this thinking it may make it easier for testing
and/or experimentation, but after feedback from review, let's go without
it for now -- we can always re-add later.
  • Loading branch information
ivoanjo committed Mar 13, 2024
1 parent 7df5858 commit 760e084
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/datadog/core/remote/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def initialize(interval:, &block)
@block = block
end

def start(allow_restart: false)
def start
Datadog.logger.debug { 'remote worker starting' }

acquire_lock

if @stop_requested && !allow_restart
if @stop_requested
Datadog.logger.debug('remote worker: refusing to restart after previous stop')
return
end
Expand Down
12 changes: 0 additions & 12 deletions spec/datadog/core/remote/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,6 @@
worker.start
expect(worker.instance_variable_get(:@started)).to be false
end

context 'when calling start with allow_restart: true' do
it 'restarts the worker after being stopped once' do
worker.start
expect(worker.instance_variable_get(:@started)).to be true

worker.stop

worker.start(allow_restart: true)
expect(worker.instance_variable_get(:@started)).to be true
end
end
end

describe '#stop' do
Expand Down

0 comments on commit 760e084

Please sign in to comment.