Skip to content

Commit

Permalink
Merge pull request #110 from ISSResearch/temp-main
Browse files Browse the repository at this point in the history
set no time limit for worker task
  • Loading branch information
githubering182 authored Dec 12, 2024
2 parents 5e40989 + 0a2c57e commit f781325
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion storage-app/src/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def default(self, o) -> Any: return getattr(o, "__json__", super().default)(o)

worker.conf.broker_url = BROKER_URL
worker.conf.result_backend = RESULT_URL
worker.conf.broker_transport_options = {"visibility_timeout": 1 * 60 * 60 * 24}

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


@worker.task(bind=True, name="produce_download_task")
@worker.task(
bind=True,
name="produce_download_task",
time_limit=None,
soft_time_limit=None
)
def produce_download_task(self, bucket_name: str, file_ids: list[str]) -> str | None:
task = Zipper(bucket_name, file_ids, self)
get_event_loop().run_until_complete(task.archive_objects())
Expand Down

0 comments on commit f781325

Please sign in to comment.