13 |
|
The main method of the class: kill a complete task |
14 |
|
""" |
15 |
|
common.logger.debug(5, "Killer::run() called") |
16 |
< |
|
17 |
< |
jStatus=common._db.queryRunJob('status','all') |
18 |
< |
human_status = common._db.queryRunJob('statusScheduler','all') |
16 |
> |
task = common._db.getTask(self.range) |
17 |
|
toBeKilled = [] |
18 |
< |
for id in self.range: |
19 |
< |
if id not in common._db.nJobs("list"): |
20 |
< |
common.logger.message("Warning: job # "+str(id)+" doesn't exists! Not possible to kill it.") |
21 |
< |
else: |
22 |
< |
if ( jStatus[id-1] in ['SS','R']): |
23 |
< |
toBeKilled.append(id) |
24 |
< |
else: |
25 |
< |
common.logger.message("Not possible to kill Job #"+str(id)+" : Status is "+human_status[id-1]) |
26 |
< |
pass |
29 |
< |
pass |
18 |
> |
for job in task.jobs: |
19 |
> |
# if id not in common._db.nJobs("list"): |
20 |
> |
# common.logger.message("Warning: job # "+str(id)+" doesn't exists! Not possible to kill it.") |
21 |
> |
# else: |
22 |
> |
if ( job.runningJob['status'] in ['SS','R','S']): |
23 |
> |
toBeKilled.append(job['jobId']) |
24 |
> |
else: |
25 |
> |
common.logger.message("Not possible to kill Job #"+str(job['jobId'])+" : Status is "+str(job.runningJob['schedulerStatus'])) |
26 |
> |
pass |
27 |
|
|
28 |
|
if len(toBeKilled)>0: |
29 |
|
common.scheduler.cancel(toBeKilled) |