mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-18 06:06:06 -04:00
Call shelf for sessions every 5 minutes
This commit is contained in:
@@ -249,6 +249,8 @@ class Controller(object):
|
||||
# Connection checker executed each minute.
|
||||
self.checker_function = RepeatingTimer(60, self.check_connection)
|
||||
self.checker_function.start()
|
||||
self.save_db = RepeatingTimer(300, self.save_data_in_db)
|
||||
self.save_db.start()
|
||||
|
||||
def start(self):
|
||||
""" Starts all buffer objects. Loads their items."""
|
||||
@@ -1494,4 +1496,8 @@ class Controller(object):
|
||||
id = data["delete"]["status"]["id"]
|
||||
for i in self.buffers:
|
||||
if hasattr(i, "remove_tweet") and hasattr(i, "name"):
|
||||
i.remove_tweet(id)
|
||||
i.remove_tweet(id)
|
||||
|
||||
def save_data_in_db(self):
|
||||
for i in session_.sessions:
|
||||
session_.sessions[i].shelve()
|
Reference in New Issue
Block a user