tarantool / queue

Create task queues, add and take jobs, monitor failed tasks
Other
237 stars 52 forks source link

Delay after relese #80

Closed olegrok closed 6 years ago

olegrok commented 6 years ago

Example: queue.tube.list_of_sites:release(15, {delay=10}) Note: in the above example, the delay option means "the task cannot be executed again for 10 seconds".

But.

q = queue.create_tube('tube', 'fifottl', { if_not_exists = true })
tarantool> q:put({'tablichka'}, { ttl = 600, ttr = 300 })
---
- [0, 'r', ['tablichka']]
...
tarantool> data = q:take()
tarantool> box.space.tube:select()
---
- - [0, 't', 1531394088891933, 600000000, 300000000, 0, 1531393773820542, ['tablichka']]
...
tarantool> q:release(0, {delay = 300})
---
- [0, '~', ['tablichka']]
...
tarantool> box.space.tube:select()
---
- - [0, '~', 1531394261199920, 600000300, 300000000, 0, 1531393773820542, ['tablichka']]
...

I suspect that delay now is in microseconds, but not seconds

Tarantool 1.9.0-61-gcd48321