Skip to content

Commit

Permalink
Don't re-create deleted rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mishaborodin committed Mar 30, 2022
1 parent 0f40cf8 commit 05fb147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion atlas/config-templates/etc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ celery==5.2.3
django-celery-beat==2.2.1
django-celery-results==2.2.0
python-json-logger==2.0.2
mod-wsgi==4.9.0
mod-wsgi==4.9.0
pandas==1.4.1
openpyxl==3.0.9
5 changes: 3 additions & 2 deletions atlas/prestage/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,9 @@ def do_staging(action_step_id, ddm):
dataset_stage.update_time = current_time
else:
delay = 2*int(action_step.get_config('delay'))
if ((existed_rule['expires_at']-timezone.now().replace(tzinfo=None))<timedelta(days=5)) and \
(task.status not in ['done','finished','broken','aborted']):
if ((existed_rule['expires_at']-timezone.now().replace(tzinfo=None)) < timedelta(days=5)) and \
(task.status not in ['done','finished','broken','aborted']) and \
((existed_rule['expires_at']-timezone.now().replace(tzinfo=None)) > timedelta(hours=2)):
try:
ddm.change_rule_lifetime(existed_rule['id'],15*86400)
except Exception as e:
Expand Down

0 comments on commit 05fb147

Please sign in to comment.