taskiq-python / taskiq-aio-pika

AMQP broker for taskiq
17 stars 9 forks source link

not working delay for large number seconds(next hour, day, ...) #25

Open ArtemIsmagilov opened 7 months ago

ArtemIsmagilov commented 7 months ago

Hi. When i try add litte number seconds in param delay - it working, i await and get execute planing task. But if i try add large number seconds(next 1 day, next 1 week and etc.) then when the time expires, I do not receive the task execution :( In dramatiq, everything works. Ignoring even for 3 minutes

s3rius commented 7 months ago

Hi. Sorry for long reply. Instead of using delay which is implemented using hack over AMQP, for large delays please consider using schedulers. Currently we can offer Redis scheduler as a dynamic scheduler which you can populate in runtime.

https://github.com/taskiq-python/taskiq-redis/blob/09e835e4bfbd9e9a50ea4de440d23e6f2e4c5fd1/taskiq_redis/schedule_source.py#L12

ArtemIsmagilov commented 7 months ago

Ok, thank you

vvanglro commented 7 months ago

Try use rabbitmq-delayed-message-exchange-plugin.

https://github.com/taskiq-python/taskiq-aio-pika?tab=readme-ov-file#retries-with-rabbitmq-delayed-message-exchange-plugin