mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Update DB and internal stats only when there are new messages instead of every time
This commit is contained in:
parent
e0059dd1e7
commit
c8ffffe5b2
|
@ -139,7 +139,7 @@ class Discussions:
|
||||||
# "Exception in feed formatter",
|
# "Exception in feed formatter",
|
||||||
# Post=str(post)[0:1000], Wiki=wiki.script_url)
|
# Post=str(post)[0:1000], Wiki=wiki.script_url)
|
||||||
messagequeue.add_messages(message_list)
|
messagequeue.add_messages(message_list)
|
||||||
if discussion_feed:
|
if message_list:
|
||||||
wiki.statistics.update(last_post=discussion_feed[-1]["id"])
|
wiki.statistics.update(last_post=discussion_feed[-1]["id"])
|
||||||
dbmanager.add(("UPDATE rcgcdb SET postid = $1 WHERE wiki = $2 AND ( postid != '-1' OR postid IS NULL )", (str(discussion_feed[-1]["id"]),
|
dbmanager.add(("UPDATE rcgcdb SET postid = $1 WHERE wiki = $2 AND ( postid != '-1' OR postid IS NULL )", (str(discussion_feed[-1]["id"]),
|
||||||
wiki.script_url))) # If this is not enough for the future, save rcid in message sending function to make sure we always send all of the changes
|
wiki.script_url))) # If this is not enough for the future, save rcid in message sending function to make sure we always send all of the changes
|
||||||
|
|
Loading…
Reference in a new issue