Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _fetch_executions(self):
if self._executions_pending:
self._executions_pending = False
execs = self._context.api.schedule_executions(
self.job_id, self.schedule_id
)
# TODO: is this necessary?
# (does Nomad API guarantee the result order? )
execs.sort(key=lambda e: e['time'])
self._executions = [
Execution(
self._context, self.job_id, self.schedule_id, exec
)
for exec in execs
]