Skip to content

Commit

Permalink
Merge branch 'master' into MCKIN-21507-commenting-code
Browse files Browse the repository at this point in the history
  • Loading branch information
mudassir-hafeez authored Jul 14, 2020
2 parents 7510d7a + 7aff721 commit cd7f39a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions completion_aggregator/cachegroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ def delete_group(self, group):
"""
Invalidate an entire entry from the cache.
"""
CacheGroupInvalidation.objects.create_or_update(group=group, invalidated_at=timezone.now())
CacheGroupInvalidation.objects.update_or_create(group=group, defaults={"invalidated_at": timezone.now()})

# Group invalidations are expected to be relatively infrequent, so we
# take this opportunity to clean old invalidation records out of the
# database.

CacheGroupInvalidation.objects.filter(invalidate_at__lt=timezone.now() - DELETE_INVALIDATIONS_AFTER).delete()
CacheGroupInvalidation.objects.filter(invalidated_at__lt=timezone.now() - DELETE_INVALIDATIONS_AFTER).delete()

0 comments on commit cd7f39a

Please sign in to comment.