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