Some job runner fixes.

This commit is contained in:
Nate Coraor
2008-11-13 19:19:03 -05:00
parent 32b4b77f74
commit 14fc955efc
2 changed files with 7 additions and 3 deletions
+3 -2
View File
@@ -64,7 +64,7 @@ class JobQueue( object ):
"""Start the job manager"""
self.app = app
# Should we use IPC to communicate (needed if forking)
self.track_jobs_in_database = app.config.get( 'track_jobs_in_database', False )
self.track_jobs_in_database = app.config.get_bool( 'track_jobs_in_database', False )
# Check if any special scheduling policy should be used. If not, default is FIFO.
sched_policy = app.config.get('job_scheduler_policy', 'FIFO')
@@ -107,7 +107,8 @@ class JobQueue( object ):
self.monitor_thread = threading.Thread( target=self.monitor )
self.monitor_thread.start()
log.info( "job manager started" )
self.check_jobs_at_startup()
if self.track_jobs_in_database:
self.check_jobs_at_startup()
def check_jobs_at_startup( self ):
"""
+4 -1
View File
@@ -267,7 +267,10 @@ class PBSJobRunner( object ):
except Empty:
pass
# Iterate over the list of watched jobs and check state
self.check_watched_items()
try:
self.check_watched_items()
except:
log.exception( "Uncaught exception checking jobs" )
# Sleep a bit before the next state check
time.sleep( 1 )