mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-11 03:12:44 +02:00
load_bbsdb with 'api'
allows for ssh file synch?
This commit is contained in:
+5
-1
@@ -16,7 +16,11 @@ def load_bbsdb():
|
||||
# load the bbs messages from the database file
|
||||
try:
|
||||
with open('data/bbsdb.pkl', 'rb') as f:
|
||||
bbs_messages = pickle.load(f)
|
||||
new_bbs_messages = pickle.load(f)
|
||||
if isinstance(new_bbs_messages, list):
|
||||
for msg in new_bbs_messages:
|
||||
if msg not in bbs_messages:
|
||||
bbs_messages.append(msg)
|
||||
except Exception as e:
|
||||
bbs_messages = [[1, "Welcome to meshBBS", "Welcome to the BBS, please post a message!",0]]
|
||||
logger.debug("System: Creating new data/bbsdb.pkl")
|
||||
|
||||
@@ -1351,6 +1351,7 @@ async def watchdog():
|
||||
# check the load_bbsdm flag to reload the BBS messages from disk
|
||||
if bbs_enabled and bbsAPI_enabled:
|
||||
load_bbsdm()
|
||||
load_bbsdb()
|
||||
|
||||
def exit_handler():
|
||||
# Close the interface and save the BBS messages
|
||||
|
||||
Reference in New Issue
Block a user