OLD | NEW |
1 # Copyright 2016 The LUCI Authors. All rights reserved. | 1 # Copyright 2016 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
4 | 4 |
5 """Lease management for machines leased from the Machine Provider. | 5 """Lease management for machines leased from the Machine Provider. |
6 | 6 |
7 Keeps a list of machine types which should be leased from the Machine Provider | 7 Keeps a list of machine types which should be leased from the Machine Provider |
8 and the list of machines of each type currently leased. | 8 and the list of machines of each type currently leased. |
9 | 9 |
10 Swarming integration with Machine Provider | 10 Swarming integration with Machine Provider |
11 ========================================== | 11 ========================================== |
12 | 12 |
13 handlers_backend.py contains a cron job which looks at each machine type and | 13 handlers_backend.py contains a cron job which looks at each machine type and |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 num_futures = len(futures) | 453 num_futures = len(futures) |
454 if num_futures < MAX_IN_FLIGHT: | 454 if num_futures < MAX_IN_FLIGHT: |
455 futures.extend( | 455 futures.extend( |
456 process_message(message, subscription) | 456 process_message(message, subscription) |
457 for message in messages[:MAX_IN_FLIGHT - num_futures]) | 457 for message in messages[:MAX_IN_FLIGHT - num_futures]) |
458 messages = messages[MAX_IN_FLIGHT - num_futures:] | 458 messages = messages[MAX_IN_FLIGHT - num_futures:] |
459 ndb.Future.wait_any(futures) | 459 ndb.Future.wait_any(futures) |
460 futures = [future for future in futures if not future.done()] | 460 futures = [future for future in futures if not future.done()] |
461 if futures: | 461 if futures: |
462 ndb.Future.wait_all(futures) | 462 ndb.Future.wait_all(futures) |
OLD | NEW |