log: cutoff at the max id past the cutoff_date
Previously we were using the min, which is always going to be equivalant to the min id in the table.
This commit is contained in:
parent
f0bf138448
commit
972e4be811
1 changed files with 1 additions and 1 deletions
|
@ -162,7 +162,7 @@ def get_stale_logs_cutoff_id(cutoff_date):
|
|||
""" Gets the most recent ID created before the cutoff_date. """
|
||||
try:
|
||||
return (LogEntry
|
||||
.select(fn.Min(LogEntry.id))
|
||||
.select(fn.Max(LogEntry.id))
|
||||
.where(LogEntry.datetime <= cutoff_date)
|
||||
.tuples())[0][0]
|
||||
except IndexError:
|
||||
|
|
Reference in a new issue