mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-16 20:08:09 +00:00
cleanup logging in multiple functions (#73)
This commit is contained in:
@ -21,14 +21,20 @@ HOURS = 60 * 60
|
||||
def schedule_tasks() -> None:
|
||||
to_schedule: Dict[UUID, List[Task]] = {}
|
||||
|
||||
not_ready_count = 0
|
||||
|
||||
for task in Task.search_states(states=[TaskState.waiting]):
|
||||
if not task.ready_to_schedule():
|
||||
not_ready_count += 1
|
||||
continue
|
||||
|
||||
if task.job_id not in to_schedule:
|
||||
to_schedule[task.job_id] = []
|
||||
to_schedule[task.job_id].append(task)
|
||||
|
||||
if not to_schedule and not_ready_count > 0:
|
||||
logging.info("tasks not ready: %d", not_ready_count)
|
||||
|
||||
for tasks in to_schedule.values():
|
||||
# TODO: for now, we're only scheduling one task per VM.
|
||||
|
||||
|
Reference in New Issue
Block a user