File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ def format(self, record):
9090
9191def build_celery_config (create_dead_letter_queue : bool ):
9292 sqs_attributes = get_sqs_attributes () if create_dead_letter_queue else {}
93- return {
93+ celery_config = {
9494 "broker_url" : Config .CELERY_BROKER_URL ,
9595 "broker_transport_options" : {
9696 "region" : Config .AWS_REGION ,
@@ -104,13 +104,18 @@ def build_celery_config(create_dead_letter_queue: bool):
104104 ),
105105 "task_routes" : (route_task ,),
106106 "worker_pool_restarts" : True ,
107- "task_ignore_result" : True ,
107+ "task_ignore_result" : True if not Config . CELERY_RESULT_BACKEND_URL else False ,
108108 "worker_hijack_root_logger" : False ,
109109 "worker_enable_remote_control" : False ,
110110 "worker_send_task_events" : False ,
111111 "task_always_eager" : Config .DEBUG and Config .IS_ENV_LOCAL_OR_TEST ,
112112 }
113113
114+ if Config .CELERY_RESULT_BACKEND_URL :
115+ celery_config ["result_backend" ] = Config .CELERY_RESULT_BACKEND_URL
116+
117+ return celery_config
118+
114119
115120CELERY_BEAT_CONFIG = {
116121 "traceback" : True ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ def load_variables(cls):
1919 cls .SENTRY_DSN = os .getenv ("SENTRY_DSN" )
2020 cls .AWS_ENDPOINT_URL = os .getenv ("AWS_ENDPOINT_URL" )
2121 cls .CELERY_BROKER_URL = os .environ ["CELERY_BROKER_URL" ] if cls .ENV != "test" else os .getenv ("CELERY_BROKER_URL" )
22+ cls .CELERY_RESULT_BACKEND_URL = os .getenv ("CELERY_RESULT_BACKEND_URL" )
2223
2324
2425Config ()
You can’t perform that action at this time.
0 commit comments