Compare commits

..

1 Commits

Author SHA1 Message Date
06f81652b7 fix up quick hack / partial code improvement for bug-140 2026-02-04 17:39:41 +11:00

View File

@@ -2775,7 +2775,7 @@ if __name__ == "__main__":
# Initial job run on startup (hence True in 1st param) # Initial job run on startup (hence True in 1st param)
try: try:
with PA_db_session() as sess: with PA_db_session() as sess:
HandleJobs(True,sess) HandleJobs(True)
except Exception as e: except Exception as e:
PAprint(f"ERROR: Initial job handle failed: {e}") PAprint(f"ERROR: Initial job handle failed: {e}")
@@ -2793,10 +2793,10 @@ if __name__ == "__main__":
# 2. Process Jobs after a successful socket connection # 2. Process Jobs after a successful socket connection
with PA_db_session() as sess: with PA_db_session() as sess:
HandleJobs(False, sess) HandleJobs(False)
# Check for scheduled tasks as well # Check for scheduled tasks as well
if ScheduledJobs(sess): if ScheduledJobs():
HandleJobs(False, sess) HandleJobs(False)
except socket.timeout: except socket.timeout:
if DEBUG: if DEBUG:
@@ -2805,8 +2805,8 @@ if __name__ == "__main__":
# 3. Process Scheduled Jobs during the timeout # 3. Process Scheduled Jobs during the timeout
try: try:
with PA_db_session() as sess: with PA_db_session() as sess:
if ScheduledJobs(sess): if ScheduledJobs():
HandleJobs(False, sess) HandleJobs(False)
except sqlalchemy.exc.OperationalError: except sqlalchemy.exc.OperationalError:
PAprint("DB Connection lost during scheduled task window. Retrying next cycle.") PAprint("DB Connection lost during scheduled task window. Retrying next cycle.")
continue continue