OLD | NEW |
1 # Copyright 2014 The Swarming Authors. All rights reserved. | 1 # Copyright 2014 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 by the Apache v2.0 license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Swarming bot management, e.g. list of known bots and their state. | 5 """Swarming bot management, e.g. list of known bots and their state. |
6 | 6 |
7 +---------+ | 7 +---------+ |
8 |BotRoot | | 8 |BotRoot | |
9 |id=bot_id| | 9 |id=bot_id| |
10 +---------+ | 10 +---------+ |
11 | | 11 | |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 Returns: | 300 Returns: |
301 Tuple (True to restart, text message explaining the reason). | 301 Tuple (True to restart, text message explaining the reason). |
302 """ | 302 """ |
303 # Periodically reboot bots to workaround OS level leaks (especially on Win). | 303 # Periodically reboot bots to workaround OS level leaks (especially on Win). |
304 running_time = state.get('running_time', 0) | 304 running_time = state.get('running_time', 0) |
305 assert isinstance(running_time, (int, float)) | 305 assert isinstance(running_time, (int, float)) |
306 period = get_bot_reboot_period(bot_id, state) | 306 period = get_bot_reboot_period(bot_id, state) |
307 if period and running_time > period: | 307 if period and running_time > period: |
308 return True, 'Periodic reboot: running longer than %ds' % period | 308 return True, 'Periodic reboot: running longer than %ds' % period |
309 return False, '' | 309 return False, '' |
OLD | NEW |