Have QSS only add security scanner notifications once

This commit is contained in:
Joseph Schorr 2016-12-05 19:08:20 -05:00
parent 3bbd8ca898
commit 97d150e281
3 changed files with 51 additions and 7 deletions

View file

@ -3,7 +3,7 @@ import json
import features
from app import secscan_notification_queue, secscan_api
from app import secscan_notification_queue
from flask import request, make_response, Blueprint, abort
from endpoints.common import route_show_if
@ -19,5 +19,9 @@ def secscan_notification():
abort(400)
notification = data['Notification']
secscan_notification_queue.put(['named', notification['Name']], json.dumps(notification))
name = ['named', notification['Name']]
if not secscan_notification_queue.alive(name):
secscan_notification_queue.put(name, json.dumps(notification))
return make_response('Okay')