Skip to content

Commit fa633cf

Browse files
committed
fix timeout check to use timeout_interval
1 parent e7db59d commit fa633cf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/concurrent/timer_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def schedule_next_task(interval = execution_interval)
308308
# @!visibility private
309309
def execute_task(completion)
310310
return nil unless @running.true?
311-
ScheduledTask.execute(execution_interval, args: [completion], &method(:timeout_task))
311+
ScheduledTask.execute(timeout_interval, args: [completion], &method(:timeout_task))
312312
_success, value, reason = @executor.execute(self)
313313
if completion.try?
314314
self.value = value

spec/concurrent/timer_task_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def trigger_observable(observable)
243243
end
244244

245245
it 'notifies all observers on timeout' do
246-
subject = TimerTask.new(execution: 0.1, timeout: 0.1) { sleep }
246+
subject = TimerTask.new(run_now: true, execution: 2, timeout: 0.1) { sleep }
247247
subject.add_observer(observer)
248248
subject.execute
249249
observer.latch.wait(1)

0 commit comments

Comments
 (0)