OLD | NEW |
1 # coding=utf-8 | 1 # coding=utf-8 |
2 # Copyright 2014 The Swarming Authors. All rights reserved. | 2 # Copyright 2014 The LUCI Authors. All rights reserved. |
3 # Use of this source code is governed by the Apache v2.0 license that can be | 3 # Use of this source code is governed by the Apache v2.0 license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Task entity that describe when a task is to be scheduled. | 6 """Task entity that describe when a task is to be scheduled. |
7 | 7 |
8 This module doesn't do the scheduling itself. It only describes the tasks ready | 8 This module doesn't do the scheduling itself. It only describes the tasks ready |
9 to be scheduled. | 9 to be scheduled. |
10 | 10 |
11 Graph of the schema: | 11 Graph of the schema: |
12 | 12 |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 too_long, | 450 too_long, |
451 deadline) | 451 deadline) |
452 | 452 |
453 | 453 |
454 def yield_expired_task_to_run(): | 454 def yield_expired_task_to_run(): |
455 """Yields all the expired TaskToRun still marked as available.""" | 455 """Yields all the expired TaskToRun still marked as available.""" |
456 now = utils.utcnow() | 456 now = utils.utcnow() |
457 for task in TaskToRun.query().filter(TaskToRun.queue_number > 0): | 457 for task in TaskToRun.query().filter(TaskToRun.queue_number > 0): |
458 if task.expiration_ts < now: | 458 if task.expiration_ts < now: |
459 yield task | 459 yield task |
OLD | NEW |