简体   繁体   中英

Revoke Celery task with SQS

I am using Celery + Kombu with Amazon SQL. The goal is to be able to a remove a task already scheduled for some specific datetime. I've tried

from celery.task.control import revoke
revoke(task_id)

but that didn't change anything. Is revoke not implemented for SQS transport? Is there some design decision behind it or it's just a lacking feature that should be implemented by some "DeleteMessage" line of code?

Unless you're using RabbitMQ, it's better to come up with a custom solution for revoking tasks. Eg instead of executing tasks, build a system of two components: scheduler task that scans your table of potential tasks and executes them when time comes. No need to revoke, you just can decide not to execute task when needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM