| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 """Commit queue executable. | 5 """Commit queue executable. |
| 6 | 6 |
| 7 Reuse Rietveld and the Chromium Try Server to process and automatically commit | 7 Reuse Rietveld and the Chromium Try Server to process and automatically commit |
| 8 patches. | 8 patches. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 suffix='.json', | 142 suffix='.json', |
| 143 delete=False) as tmp_file: | 143 delete=False) as tmp_file: |
| 144 with open(db_path) as db_file: | 144 with open(db_path) as db_file: |
| 145 shutil.copyfileobj(db_file, tmp_file) | 145 shutil.copyfileobj(db_file, tmp_file) |
| 146 return tmp_file.name | 146 return tmp_file.name |
| 147 | 147 |
| 148 | 148 |
| 149 def main(): | 149 def main(): |
| 150 # Set a default timeout for sockets. This is critical when talking to remote | 150 # Set a default timeout for sockets. This is critical when talking to remote |
| 151 # services like AppEngine and buildbot. | 151 # services like AppEngine and buildbot. |
| 152 socket.setdefaulttimeout(70.0) | 152 # TODO(phajdan.jr): This used to be 70s. Investigate lowering it again. |
| 153 socket.setdefaulttimeout(60.0 * 15) |
| 153 | 154 |
| 154 parser = optparse.OptionParser( | 155 parser = optparse.OptionParser( |
| 155 description=sys.modules['__main__'].__doc__) | 156 description=sys.modules['__main__'].__doc__) |
| 156 project_choices = projects.supported_projects() | 157 project_choices = projects.supported_projects() |
| 157 parser.add_option('-v', '--verbose', action='store_true') | 158 parser.add_option('-v', '--verbose', action='store_true') |
| 158 parser.add_option( | 159 parser.add_option( |
| 159 '--no-dry-run', | 160 '--no-dry-run', |
| 160 action='store_false', | 161 action='store_false', |
| 161 dest='dry_run', | 162 dest='dry_run', |
| 162 default=True, | 163 default=True, |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 # CQ generally doesn't exit by itself, but if we ever get here, it looks | 386 # CQ generally doesn't exit by itself, but if we ever get here, it looks |
| 386 # like a clean shutdown so remove the landmine file. | 387 # like a clean shutdown so remove the landmine file. |
| 387 # TODO(phajdan.jr): Do we ever get here? | 388 # TODO(phajdan.jr): Do we ever get here? |
| 388 os.remove(landmine_path) | 389 os.remove(landmine_path) |
| 389 return 0 | 390 return 0 |
| 390 | 391 |
| 391 | 392 |
| 392 if __name__ == '__main__': | 393 if __name__ == '__main__': |
| 393 fix_encoding.fix_encoding() | 394 fix_encoding.fix_encoding() |
| 394 sys.exit(main()) | 395 sys.exit(main()) |
| OLD | NEW |