Skip to content

Commit

Permalink
Force tasks with no files as failed
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Nov 8, 2024
1 parent 6eaea92 commit ed92960
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/src/zimitfrontend/routes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def convert_hook_to_mail(
if task.status not in ("requested", "succeeded", "failed", "canceled"):
return MailToSend(status=SUCCESS)

# force fail status, see https://github.com/openzim/zimit-frontend/issues/90
if task.files is None or len(task.files) == 0:
task.status = "failed"

Check warning on line 114 in api/src/zimitfrontend/routes/utils.py

View check run for this annotation

Codecov / codecov/patch

api/src/zimitfrontend/routes/utils.py#L114

Added line #L114 was not covered by tests

context = {
"base_url": ApiConfiguration.public_url,
"download_url": ApiConfiguration.zim_download_url,
Expand Down

0 comments on commit ed92960

Please sign in to comment.