Skip to content

Commit

Permalink
[Backport to 3.3.x][Fixes #9064] Improve Upload Workflow resources st…
Browse files Browse the repository at this point in the history
…ate management] (#9065)

* [Fixes #9064Improve Upload Workflow resources state management]

* [Fixes #9064] Improve Upload Workflow resources state management

* [Fixes #9064] Improve Upload Workflow resources state management
  • Loading branch information
Alessio Fabiani authored Apr 8, 2022
1 parent 1fa8fb9 commit de57e4a
Show file tree
Hide file tree
Showing 19 changed files with 392 additions and 447 deletions.
2 changes: 2 additions & 0 deletions geonode/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,8 @@ def clear_dirty_state(self):
def set_processing_state(self, state):
if state == "PROCESSED":
self.clear_dirty_state()
else:
self.set_dirty_state()

@property
def processed(self):
Expand Down
9 changes: 5 additions & 4 deletions geonode/br/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
name='geonode.br.tasks.restore_notification',
queue='email',
expires=600,
time_limit=600,
acks_late=False,
autoretry_for=(Exception, ),
retry_kwargs={'max_retries': 3, 'countdown': 10},
retry_backoff=True,
retry_backoff_max=700,
retry_jitter=True)
retry_kwargs={'max_retries': 5},
retry_backoff=3,
retry_backoff_max=30,
retry_jitter=False)
def restore_notification(recipients: List, backup_file: str, backup_md5: str, exception: str = None):
"""
Function sending a CC email report of the restore procedure to a provided emails.
Expand Down
27 changes: 15 additions & 12 deletions geonode/documents/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@
name='geonode.documents.tasks.create_document_thumbnail',
queue='geonode',
expires=600,
time_limit=600,
acks_late=False,
autoretry_for=(Exception, ),
retry_kwargs={'max_retries': 2, 'countdown': 10},
retry_backoff=True,
retry_backoff_max=700,
retry_jitter=True)
retry_kwargs={'max_retries': 5},
retry_backoff=3,
retry_backoff_max=30,
retry_jitter=False)
def create_document_thumbnail(self, object_id):
"""
Create thumbnail for a document.
Expand Down Expand Up @@ -118,12 +119,13 @@ def create_document_thumbnail(self, object_id):
name='geonode.documents.tasks.delete_orphaned_document_files',
queue='cleanup',
expires=600,
time_limit=600,
acks_late=False,
autoretry_for=(Exception, ),
retry_kwargs={'max_retries': 2, 'countdown': 10},
retry_backoff=True,
retry_backoff_max=700,
retry_jitter=True)
retry_kwargs={'max_retries': 5},
retry_backoff=3,
retry_backoff_max=30,
retry_jitter=False)
def delete_orphaned_document_files(self):
from geonode.documents.utils import delete_orphaned_document_files
delete_orphaned_document_files()
Expand All @@ -134,12 +136,13 @@ def delete_orphaned_document_files(self):
name='geonode.documents.tasks.delete_orphaned_thumbnails',
queue='cleanup',
expires=600,
time_limit=600,
acks_late=False,
autoretry_for=(Exception, ),
retry_kwargs={'max_retries': 2, 'countdown': 10},
retry_backoff=True,
retry_backoff_max=700,
retry_jitter=True)
retry_kwargs={'max_retries': 5},
retry_backoff=3,
retry_backoff_max=30,
retry_jitter=False)
def delete_orphaned_thumbnails(self):
from geonode.base.utils import delete_orphaned_thumbs
delete_orphaned_thumbs()
Loading

0 comments on commit de57e4a

Please sign in to comment.