Fixes and added tests for the security notification worker
Fixes #1301 - Ensures that the worker uses pagination properly - Ensures that the worker handles failure as expected - Moves marking the notification as read to after the worker processes it - Increases the number of layers requested to 100
This commit is contained in:
parent
e8a511d526
commit
aa5587c93c
4 changed files with 75 additions and 15 deletions
|
@ -19,14 +19,5 @@ def secscan_notification():
|
|||
abort(400)
|
||||
|
||||
notification = data['Notification']
|
||||
|
||||
# Queue the notification to be processed.
|
||||
item_id = secscan_notification_queue.put(['named', notification['Name']],
|
||||
json.dumps(notification))
|
||||
|
||||
# Mark the notification as read.
|
||||
if not secscan_api.mark_notification_read(notification['Name']):
|
||||
secscan_notification_queue.cancel(item_id)
|
||||
abort(400)
|
||||
|
||||
secscan_notification_queue.put(['named', notification['Name']], json.dumps(notification))
|
||||
return make_response('Okay')
|
||||
|
|
Reference in a new issue