Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PoC about a retry bug on Celery
from celery import Celery
class config(object):
CELERY_BROKER_CONNECTION_TIMEOUT = 1 # 1s
CELERY_BROKER_CONNECTION_MAX_RETRIES = 0
CELERY_BROKER_CONNECTION_RETRY = False
CELERY_TASK_PUBLISH_RETRY = False
CELERY_TASK_PUBLISH_RETRY_POLICY = {
'max_retries': 0,
'interval_start': 0,
'interval_step': 1,
'interval_max': 1,
}
CELERY_CACHE_BACKEND = "memory"
app = Celery(
'test',
broker='amqp://aaa:bbb@localhost:1234//',
)
app.config_from_object(config, namespace='CELERY')
@app.task
def test_task():
print("Executed")
if __name__ == '__main__':
print("Sending task...")
test_task.apply_async((), retry=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.