Skip to content

Commit

Permalink
resty/concurrent/timer_task: fix params in call to schedule_next()
Browse files Browse the repository at this point in the history
  • Loading branch information
davidor committed Jun 29, 2018
1 parent b3e60d7 commit bc4c74a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gateway/src/resty/concurrent/timer_task.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ run_periodic = function(run_now, id, func, args, interval)
func(unpack(args))
end

schedule_next(interval, id, func, args, interval)
schedule_next(id, func, args, interval)
end

-- Note: ngx.timer.at always sends "premature" as the first param.
Expand Down
4 changes: 4 additions & 0 deletions spec/resty/concurrent/timer_task_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ describe('TimerTask', function()
timer_task:execute(true)

assert.stub(ngx_timer_stub).was_called()

-- Can't check all the arguments of ngx.timer.at because it calls an
-- private function but at least we can check the interval (first arg)
assert.equals(interval, ngx_timer_stub.calls[1].vals[1])
end)
end)

Expand Down

0 comments on commit bc4c74a

Please sign in to comment.