Files
SMSBoom/celery_server/config.py
AdminWhaleFall 82c7d38b59 feat: celery 异步框架测试运行。
celery 不支持在 windows 上调用 async 函数。所有要部署在 linux 上,部署待测试。
2022-05-14 22:57:28 +08:00

11 lines
394 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#broker(消息中间件来接收和发送任务消息)
BROKER_URL = 'redis://localhost:6379/1'
#backend(存储worker执行的结果)
CELERY_RESULT_BACKEND = 'redis://localhost:6379/2'
#设置时间参照不设置默认使用的UTC时间
CELERY_TIMEZONE = 'Asia/Shanghai'
#指定任务的序列化
CELERY_TASK_SERIALIZER='json'
#指定执行结果的序列化
CELERY_RESULT_SERIALIZER='json'