mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fix cleanup code so it doesn't crash
This commit is contained in:
parent
077a103d35
commit
aef23d26e9
|
@ -57,10 +57,10 @@ def clean_entries():
|
|||
cleanup = db_cursor.execute(
|
||||
"SELECT message_id FROM messages WHERE message_id NOT IN (SELECT message_id FROM messages ORDER BY message_id desc LIMIT 50);")
|
||||
for row in cleanup:
|
||||
db_cursor.execute("DELETE FROM messages WHERE message_id = ?", (row[0]))
|
||||
db_cursor.execute("DELETE FROM messages WHERE message_id = ?", (row[0],))
|
||||
cleanup = db_cursor.execute("SELECT msg_id FROM event WHERE msg_id NOT IN (SELECT msg_id FROM event ORDER BY msg_id desc LIMIT 50);")
|
||||
for row in cleanup:
|
||||
db_cursor.execute("DELETE FROM event WHERE msg_id = ?", (row[0]))
|
||||
db_cursor.execute("DELETE FROM event WHERE msg_id = ?", (row[0],))
|
||||
db_connection.commit()
|
||||
|
||||
db_connection, db_cursor = create_connection()
|
||||
|
|
Loading…
Reference in a new issue