mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-13 10:38:08 +00:00
only record failures generated prior to stopping (#83)
This commit is contained in:
@ -154,6 +154,17 @@ class Task(BASE_TASK, ORMMixin):
|
||||
task = tasks[0]
|
||||
return task
|
||||
|
||||
def mark_failed(self, error: Error) -> None:
|
||||
if self.state in [TaskState.stopped, TaskState.stopping]:
|
||||
logging.debug(
|
||||
"ignoring post-task stop failures for %s:%s", self.job_id, self.task_id
|
||||
)
|
||||
return
|
||||
|
||||
self.error = error
|
||||
self.state = TaskState.stopping
|
||||
self.save()
|
||||
|
||||
def get_pool(self) -> Optional[Pool]:
|
||||
if self.config.pool:
|
||||
pool = Pool.get_by_name(self.config.pool.pool_name)
|
||||
|
Reference in New Issue
Block a user