Skip to content
Snippets Groups Projects
Commit 3f623744 authored by Finn's avatar Finn
Browse files

BotsInterface checks to see if lease is cancelled.

parent 0573a8a8
No related branches found
No related tags found
Loading
Pipeline #34656870 failed
......@@ -98,6 +98,11 @@ class BotsInterface:
def _check_lease_state(self, lease):
# Check for cancelled lease
if self._scheduler.get_lease_cancelled(lease.id):
return None
# If not cancelled, update the status
self._scheduler.update_job_lease(lease)
lease_state = LeaseState(lease.state)
......
......@@ -117,6 +117,10 @@ class Job:
else:
return None
@property
def lease_cancelled(self):
return self.__lease_cancelled
@property
def n_tries(self):
return self._n_tries
......
......@@ -135,6 +135,10 @@ class Scheduler:
"""Returns the lease associated to job, if any have been emitted yet."""
return self.jobs[job_name].lease
def get_job_lease_cancelled(self, job_name):
"""Returns true if the lease is cancelled"""
return self.jobs[job_name].lease_cancelled
def get_job_operation(self, job_name):
"""Returns the operation associated to job."""
return self.jobs[job_name].operation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment