Commit 6aadfdfd authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'huge-fixes' into 'master'

Refresh the status of jobs from SGE before listing them

See merge request !30
parents 6609ab6d 7b0c44f1
Pipeline #34348 passed with stages
in 12 minutes and 46 seconds
...@@ -205,6 +205,9 @@ def run_scheduler(args): ...@@ -205,6 +205,9 @@ def run_scheduler(args):
def list(args): def list(args):
"""Lists the jobs in the given database.""" """Lists the jobs in the given database."""
jm = setup(args) jm = setup(args)
if not args.local:
# update the status of jobs from SGE before listing them.
jm.communicate(job_ids=get_ids(args.job_ids))
jm.list(job_ids=get_ids(args.job_ids), print_array_jobs=args.print_array_jobs, print_dependencies=args.print_dependencies, status=args.status, long=args.long, print_times=args.print_times, ids_only=args.ids_only, names=args.names) jm.list(job_ids=get_ids(args.job_ids), print_array_jobs=args.print_array_jobs, print_dependencies=args.print_dependencies, status=args.status, long=args.long, print_times=args.print_times, ids_only=args.ids_only, names=args.names)
......
...@@ -200,7 +200,7 @@ class JobManagerSGE(JobManager): ...@@ -200,7 +200,7 @@ class JobManagerSGE(JobManager):
if job.status in ('executing', 'queued', 'waiting'): if job.status in ('executing', 'queued', 'waiting'):
qdel(job.id, context=self.context) qdel(job.id, context=self.context)
logger.info("Stopped job '%s' in the SGE grid." % job) logger.info("Stopped job '%s' in the SGE grid." % job)
job.submit() job.submit()
self.session.commit() self.session.commit()
self.unlock() self.unlock()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment