Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/concurrent/timer_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def schedule_next_task(interval = execution_interval)
# @!visibility private
def execute_task(completion)
return nil unless @running.true?
ScheduledTask.execute(execution_interval, args: [completion], &method(:timeout_task))
ScheduledTask.execute(timeout_interval, args: [completion], &method(:timeout_task))
_success, value, reason = @executor.execute(self)
if completion.try?
self.value = value
Expand Down
2 changes: 1 addition & 1 deletion spec/concurrent/timer_task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def trigger_observable(observable)
end

it 'notifies all observers on timeout' do
subject = TimerTask.new(execution: 0.1, timeout: 0.1) { sleep }
subject = TimerTask.new(run_now: true, execution: 2, timeout: 0.1) { sleep }
subject.add_observer(observer)
subject.execute
observer.latch.wait(1)
Expand Down