Skip to content

Commit

Permalink
Merge pull request #328 from tehhuimin/master
Browse files Browse the repository at this point in the history
Make chroniker only deletes the job's logs when exceed maximum threshold
  • Loading branch information
chrisspen authored Jun 26, 2024
2 parents 3b1647a + 6ad2465 commit ef00232
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chroniker/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def save(self, **kwargs):
log_q = self.logs.all().order_by('-run_start_datetime')[cutoff:]
if log_q.exists():
cutoff_dt = log_q[0].run_start_datetime
qs = Log.objects.filter(run_start_datetime__lte=cutoff_dt)
qs = Log.objects.filter(job=self.id, run_start_datetime__lte=cutoff_dt)
for o in qs:
o.delete()

Expand Down

0 comments on commit ef00232

Please sign in to comment.