load_bbsdb with 'api'

allows for ssh file synch?
This commit is contained in:
SpudGunMan
2025-10-04 12:54:20 -07:00
parent 5c0b04f0b7
commit 1a49a81cf5
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -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")
+1
View File
@@ -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