diff --git a/data/model/log.py b/data/model/log.py index 0dbf53b87..13c21429d 100644 --- a/data/model/log.py +++ b/data/model/log.py @@ -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: