Skip to content

Commit 0a2c57e

Browse files
set no time limit for worker task
1 parent 6a98604 commit 0a2c57e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

storage-app/src/worker.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def default(self, o) -> Any: return getattr(o, "__json__", super().default)(o)
1717

1818
worker.conf.broker_url = BROKER_URL
1919
worker.conf.result_backend = RESULT_URL
20+
worker.conf.broker_transport_options = {"visibility_timeout": 1 * 60 * 60 * 24}
2021

2122
register(
2223
"custom_encoder",
@@ -26,7 +27,12 @@ def default(self, o) -> Any: return getattr(o, "__json__", super().default)(o)
2627
)
2728

2829

29-
@worker.task(bind=True, name="produce_download_task")
30+
@worker.task(
31+
bind=True,
32+
name="produce_download_task",
33+
time_limit=None,
34+
soft_time_limit=None
35+
)
3036
def produce_download_task(self, bucket_name: str, file_ids: list[str]) -> str | None:
3137
task = Zipper(bucket_name, file_ids, self)
3238
get_event_loop().run_until_complete(task.archive_objects())

0 commit comments

Comments
 (0)