| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from collections import defaultdict | 5 from collections import defaultdict |
| 6 import datetime | 6 import datetime |
| 7 import logging | 7 import logging |
| 8 import time | 8 import time |
| 9 | 9 |
| 10 from common.http_client_appengine import HttpClientAppengine as HttpClient | 10 from common.http_client_appengine import HttpClientAppengine as HttpClient |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 task.status = analysis_status.RUNNING | 123 task.status = analysis_status.RUNNING |
| 124 task.put() | 124 task.put() |
| 125 time.sleep(server_query_interval_seconds) | 125 time.sleep(server_query_interval_seconds) |
| 126 if time.time() > deadline: | 126 if time.time() > deadline: |
| 127 # Updates status as ERROR. | 127 # Updates status as ERROR. |
| 128 task = self._GetSwarmingTask(*call_args) | 128 task = self._GetSwarmingTask(*call_args) |
| 129 task.status = analysis_status.ERROR | 129 task.status = analysis_status.ERROR |
| 130 task.put() | 130 task.put() |
| 131 logging.error('Swarming task timed out after %d hours.' % timeout_hours) | 131 logging.error('Swarming task timed out after %d hours.' % timeout_hours) |
| 132 break # Stops the loop and return. | 132 break # Stops the loop and return. |
| 133 # Update swarming task metadate. | 133 # Update swarming task metadata. |
| 134 task = self._GetSwarmingTask(*call_args) | 134 task = self._GetSwarmingTask(*call_args) |
| 135 task.created_time = self._ConvertDateTime(data.get('created_ts')) | 135 task.created_time = self._ConvertDateTime(data.get('created_ts')) |
| 136 task.started_time = self._ConvertDateTime(data.get('started_ts')) | 136 task.started_time = self._ConvertDateTime(data.get('started_ts')) |
| 137 task.completed_time = self._ConvertDateTime(data.get('completed_ts')) | 137 task.completed_time = self._ConvertDateTime(data.get('completed_ts')) |
| 138 task.put() | 138 task.put() |
| 139 | 139 |
| 140 return step_name, step_name_no_platform | 140 return step_name, step_name_no_platform |
| OLD | NEW |