Use appropriate function to remove a line in unread_message table. See #3793.
This commit is contained in:
parent
4e15d0f0d6
commit
11e4945158
|
@ -371,12 +371,7 @@ class Logger:
|
||||||
results = self.cur.fetchall()
|
results = self.cur.fetchall()
|
||||||
if len(results) == 0:
|
if len(results) == 0:
|
||||||
# Log line is no more in logs table. remove it from unread_messages
|
# Log line is no more in logs table. remove it from unread_messages
|
||||||
sql = 'DELETE FROM unread_messages WHERE message_id=%s' % msg_id
|
self.set_read_messages([msg_id])
|
||||||
self.cur.execute(sql)
|
|
||||||
try:
|
|
||||||
self.con.commit()
|
|
||||||
except sqlite.OperationalError, e:
|
|
||||||
print >> sys.stderr, str(e)
|
|
||||||
continue
|
continue
|
||||||
all_messages.append(results[0])
|
all_messages.append(results[0])
|
||||||
return all_messages
|
return all_messages
|
||||||
|
|
Loading…
Reference in New Issue