Skip to content

Commit

Permalink
Merge branch 'main' into feature/observing-mode-parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jnation3406 committed Sep 15, 2021
2 parents 529ead8 + 900a408 commit 2b9cee5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions observation_portal/observations/tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dramatiq
import logging
from datetime import datetime, timedelta
from datetime import timedelta
from django.utils import timezone

from observation_portal.observations.models import Observation

Expand All @@ -9,6 +10,6 @@

@dramatiq.actor()
def delete_old_observations():
cutoff = datetime.utcnow() - timedelta(days=14)
cutoff = timezone.now() - timedelta(days=14)
logger.info(f'Deleting CANCELED observations before cutoff date {cutoff}')
Observation.delete_old_observations(cutoff)

0 comments on commit 2b9cee5

Please sign in to comment.