Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if report exist when celery task failed #381

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/source/others/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
Changelog
==========


2023.10.1+dev (XXXX-XX-XX)
---------------------------

**Bugfix**

- Check if report existing to update it when celery task fail
- Source auto refresh exclude PENDING source now


2023.10.1 (2023-10-01)
---------------------------

Expand Down
2 changes: 1 addition & 1 deletion project/geosource/periodics.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def auto_refresh_source():
countdown = 0
for source in Source.objects.all():
for source in Source.objects.exclude(status=Source.Status.PENDING):
logger.info(f"Is refresh for {source}<{source.id}> needed?")
if source.should_refresh():
logger.info(f"Schedule refresh for source {source}<{source.id}>...")
Expand Down
2 changes: 1 addition & 1 deletion project/geosource/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def set_failure_state(task, method, message, instance=None):
},
}
task.update_state(**state)
if instance and hasattr(instance, "report"):
if instance and hasattr(instance, "report") and instance.report is not None:
text = ""
for key, value in state["meta"].items():
text += f"{key}: {value},"
Expand Down