| OLD | NEW |
| 1 # Copyright 2016 The LUCI Authors. All rights reserved. | 1 # Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Utilities for interacting with Pub/Sub.""" | 5 """Utilities for interacting with Pub/Sub.""" |
| 6 | 6 |
| 7 import base64 | 7 import base64 |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 | 10 |
| 11 from google.appengine.api import app_identity | 11 from google.appengine.api import app_identity |
| 12 from google.appengine.ext import ndb | 12 from google.appengine.ext import ndb |
| 13 | 13 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 utilities.batch_process_async(response.get('receivedMessages', []), process) | 86 utilities.batch_process_async(response.get('receivedMessages', []), process) |
| 87 | 87 |
| 88 | 88 |
| 89 def schedule_poll(): | 89 def schedule_poll(): |
| 90 """Enqueues tasks to poll for Pub/Sub messages.""" | 90 """Enqueues tasks to poll for Pub/Sub messages.""" |
| 91 if not utils.enqueue_task( | 91 if not utils.enqueue_task( |
| 92 '/internal/queues/process-pubsub-messages', | 92 '/internal/queues/process-pubsub-messages', |
| 93 'process-pubsub-messages', | 93 'process-pubsub-messages', |
| 94 ): | 94 ): |
| 95 logging.warning('Failed to enqueue task for Pub/Sub') | 95 logging.warning('Failed to enqueue task for Pub/Sub') |
| OLD | NEW |