Permalink
Browse files

Debugging changes, and handle the case of if there is no next job cur…

…rently.
  • Loading branch information...
1 parent a8972a9 commit 2c7eed2c4638ae0a60a598f1ce98b6e63b24c0b4 @jd-boyd committed May 29, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 pbatch/daemons/worker.py
@@ -41,9 +41,7 @@ def setup_file(j, std):
opts.update(setup_file(j, 'stdout'))
opts.update(setup_file(j, 'stderr'))
-
pbatch.client.mark_job_running(j.job_id)
- ret = None
try:
ret = subprocess.call(full_cmd, **opts)
finally:
@@ -69,7 +67,7 @@ def fork_job(j):
print "C:"
os.setgid(j.gid)
os.setuid(j.uid)
- print "ENV:", repr(j.env)
+ #print "ENV:", repr(j.env)
if j.env:
for k in j.env:
os.environ[k] = j.env[k]
@@ -78,7 +76,11 @@ def fork_job(j):
def start():
job = pbatch.client.get_next_job()
- fork_job(job)
+ if job:
+ print "Running job:", job.job_id
+ fork_job(job)
+ else:
+ print "Got no job."
if __name__=="__main__":
start()

0 comments on commit 2c7eed2

Please sign in to comment.