Skip to content

Commit

Permalink
Merge pull request #725 from yads/master
Browse files Browse the repository at this point in the history
fix timeout check to use timeout_interval
  • Loading branch information
pitr-ch committed May 30, 2018
2 parents a9e07bf + fa633cf commit 9d2505c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/concurrent/timer_task.rb
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
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

0 comments on commit 9d2505c

Please sign in to comment.