| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 datetime import datetime | 5 from datetime import datetime |
| 6 import json | 6 import json |
| 7 import time | 7 import time |
| 8 | 8 |
| 9 from google.appengine.ext import ndb | 9 from google.appengine.ext import ndb |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 if error_dict: | 151 if error_dict: |
| 152 try_job_data.error = error_dict | 152 try_job_data.error = error_dict |
| 153 try_job_data.error_code = error_code | 153 try_job_data.error_code = error_code |
| 154 | 154 |
| 155 try_job_data.put() | 155 try_job_data.put() |
| 156 | 156 |
| 157 @ndb.transactional | 157 @ndb.transactional |
| 158 def _UpdateTryJobResult( | 158 def _UpdateTryJobResult( |
| 159 self, status, master_name, builder_name, build_number, try_job_type, | 159 self, status, master_name, builder_name, build_number, try_job_type, |
| 160 try_job_id, try_job_url, result_content=None): | 160 try_job_id, try_job_url, result_content=None): |
| 161 """Updates try job result based on responsed try job status and result.""" | 161 """Updates try job result based on response try job status and result.""" |
| 162 result = { | 162 result = { |
| 163 'report': result_content, | 163 'report': result_content, |
| 164 'url': try_job_url, | 164 'url': try_job_url, |
| 165 'try_job_id': try_job_id, | 165 'try_job_id': try_job_id, |
| 166 } | 166 } |
| 167 | 167 |
| 168 try_job_result = WfTryJob.Get(master_name, builder_name, build_number) | 168 try_job_result = WfTryJob.Get(master_name, builder_name, build_number) |
| 169 if try_job_type == TryJobType.COMPILE: | 169 if try_job_type == TryJobType.COMPILE: |
| 170 result_to_update = try_job_result.compile_results | 170 result_to_update = try_job_result.compile_results |
| 171 else: | 171 else: |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 already_set_started = True | 249 already_set_started = True |
| 250 | 250 |
| 251 if time.time() > deadline: # pragma: no cover | 251 if time.time() > deadline: # pragma: no cover |
| 252 self._UpdateTryJobMetadata(try_job_data, start_time, build, error, True) | 252 self._UpdateTryJobMetadata(try_job_data, start_time, build, error, True) |
| 253 # Explicitly abort the whole pipeline. | 253 # Explicitly abort the whole pipeline. |
| 254 raise pipeline.Abort( | 254 raise pipeline.Abort( |
| 255 'Try job %s timed out after %d hours.' % ( | 255 'Try job %s timed out after %d hours.' % ( |
| 256 try_job_id, timeout_hours)) | 256 try_job_id, timeout_hours)) |
| 257 | 257 |
| 258 time.sleep(pipeline_wait_seconds) # pragma: no cover | 258 time.sleep(pipeline_wait_seconds) # pragma: no cover |
| OLD | NEW |