1
0
Fork 0

Order by id instead of time because timestamps may be nonmonotonic.

Probably a result of moderator actions, I found that items with a lower
id could have a higher timestamp, enough to offset it by 2,000 ids.
This commit is contained in:
voussoir 2020-10-27 22:27:10 -07:00
parent eff67f845d
commit e0862f9e44

View file

@ -220,7 +220,7 @@ def select_item(id):
return item return item
def select_latest_id(): def select_latest_id():
cur = sql.execute('SELECT id FROM items ORDER BY time DESC, id ASC LIMIT 1') cur = sql.execute('SELECT id FROM items ORDER BY id DESC LIMIT 1')
row = cur.fetchone() row = cur.fetchone()
if row is None: if row is None:
return None return None