Move security notification work into its own method to allow for return values

Fixes #1302
Fixes #1304
This commit is contained in:
Joseph Schorr 2016-03-28 16:41:37 -04:00
parent 685dd1a925
commit d62ec22fc9
3 changed files with 15 additions and 3 deletions

View file

@ -15,6 +15,14 @@ _LAYER_LIMIT = 100 # The number of layers to request on each page.
class SecurityNotificationWorker(QueueWorker):
def process_queue_item(self, data):
self.perform_notification_work(data)
def perform_notification_work(self, data):
""" Performs the work for handling a security notification as referenced by the given data
object. Returns True on successful handling, False on non-retryable failure and raises
a JobException on retryable failure.
"""
notification_name = data['Name']
current_page = data.get('page', None)