| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import logging | 5 import logging |
| 6 import time | 6 import time |
| 7 import traceback | 7 import traceback |
| 8 | 8 |
| 9 from app_yaml_helper import AppYamlHelper | 9 from app_yaml_helper import AppYamlHelper |
| 10 from appengine_wrappers import ( | 10 from appengine_wrappers import ( |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 try: | 58 try: |
| 59 for i, item in enumerate(items): | 59 for i, item in enumerate(items): |
| 60 def error_message(detail): | 60 def error_message(detail): |
| 61 return '%s: error rendering %s (%s of %s): %s' % ( | 61 return '%s: error rendering %s (%s of %s): %s' % ( |
| 62 title, item, i + 1, len(items), detail) | 62 title, item, i + 1, len(items), detail) |
| 63 try: | 63 try: |
| 64 response = request_callback(item) | 64 response = request_callback(item) |
| 65 if response.status == 200: | 65 if response.status == 200: |
| 66 success_count += 1 | 66 success_count += 1 |
| 67 else: | 67 else: |
| 68 _cronlog.error(error_message('response status %s', response.status)) | 68 _cronlog.error(error_message('response status %s' % response.status)) |
| 69 failure_count += 1 | 69 failure_count += 1 |
| 70 except Exception as e: | 70 except Exception as e: |
| 71 _cronlog.error(error_message(traceback.format_exc())) | 71 _cronlog.error(error_message(traceback.format_exc())) |
| 72 failure_count += 1 | 72 failure_count += 1 |
| 73 if IsDeadlineExceededError(e): raise | 73 if IsDeadlineExceededError(e): raise |
| 74 finally: | 74 finally: |
| 75 elapsed_seconds = time.time() - start_time | 75 elapsed_seconds = time.time() - start_time |
| 76 _cronlog.info('%s: rendered %s of %s with %s failures in %s seconds', | 76 _cronlog.info('%s: rendered %s of %s with %s failures in %s seconds', |
| 77 title, success_count, len(items), failure_count, elapsed_seconds); | 77 title, success_count, len(items), failure_count, elapsed_seconds); |
| 78 return success_count == len(items) | 78 return success_count == len(items) |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 compiled_host_fs_factory = CompiledFileSystem.Factory( | 250 compiled_host_fs_factory = CompiledFileSystem.Factory( |
| 251 host_file_system, | 251 host_file_system, |
| 252 object_store_creator) | 252 object_store_creator) |
| 253 return ServerInstance(object_store_creator, | 253 return ServerInstance(object_store_creator, |
| 254 host_file_system, | 254 host_file_system, |
| 255 app_samples_file_system, | 255 app_samples_file_system, |
| 256 '', | 256 '', |
| 257 compiled_host_fs_factory, | 257 compiled_host_fs_factory, |
| 258 branch_utility, | 258 branch_utility, |
| 259 host_file_system_creator) | 259 host_file_system_creator) |
| OLD | NEW |