| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Out of band HTTP push.""" | 4 """Out of band HTTP push.""" |
| 5 | 5 |
| 6 import Queue | 6 import Queue |
| 7 import json | 7 import json |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import threading | 10 import threading |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 urllib.urlopen(url, urllib.urlencode(data), params).read() | 119 urllib.urlopen(url, urllib.urlencode(data), params).read() |
| 120 except IOError as e: | 120 except IOError as e: |
| 121 logging.error(e) | 121 logging.error(e) |
| 122 for item in items: | 122 for item in items: |
| 123 self.queue.put(item) | 123 self.queue.put(item) |
| 124 if not done: | 124 if not done: |
| 125 time.sleep(1) | 125 time.sleep(1) |
| 126 # Don't retry if done. | 126 # Don't retry if done. |
| 127 except Exception as e: | 127 except Exception as e: |
| 128 traceback.print_exc() | 128 traceback.print_exc() |
| 129 errors.end_stack(e) | 129 errors.send_stack(e) |
| OLD | NEW |