def _set_task_status(self, state): update = TaskStatus(state=state, timestamp_ms=int(self._clock.time() * 1000), runner_pid=os.getpid(), runner_uid=os.getuid()) runner_ckpt = RunnerCkpt(task_status=update) self._dispatcher.dispatch(self._state, runner_ckpt, self._recovery)
def write_task_state(state): update = TaskStatus(state=state, timestamp_ms=int(clock.time() * 1000), runner_pid=os.getpid(), runner_uid=os.getuid()) ckpt.write(RunnerCkpt(task_status=update))