Skip to content

Commit 183155e

Browse files
authored
fix(notificator): process queue more often (#2407)
* fix(notificator): process queue more often RHINENG-28479 * chore(notificator): make log messages shorter, adjust debug levels
1 parent 27d7b2a commit 183155e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

notificator/notificator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
CFG = Config()
3232
LOGGER = get_logger(__name__)
33-
NOTIFICATOR_PERIOD = 3 * 60 # 3 minutes
33+
NOTIFICATOR_PERIOD = 60 # 1 minute
3434

3535

3636
class NotificatorConditions:

notificator/notificator_queue.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ async def _process_normal_queue(self):
252252
# account-level: existing dedup logic
253253
if not await self._is_already_notified(item.rh_account_id, item.cve_id, notif_event):
254254
self._send_kafka_notif(item.org_id, inventory_id, display_name, notif_event.value, cve_events, loop=self.loop)
255-
LOGGER.info("Sending notification about CVE: %s (%s) for %s org", item.cve, item.cve_id, item.org_id)
255+
LOGGER.info("Sent %s, cve=%s, org_id=%s", notif_event.value, item.cve, item.org_id)
256256
SENT_NOTIFICATIONS.inc()
257257
new_notified.add(notif_event)
258258
else:
259-
LOGGER.info("Skipping notification about CVE: %s (%s), already sent for %s org", item.cve, item.cve_id, item.org_id)
259+
LOGGER.debug("Skipped %s (already sent), cve=%s, org_id=%s", notif_event.value, item.cve, item.org_id)
260260

261261
# register sent account-level notifs
262262
if new_notified:
@@ -267,7 +267,7 @@ async def _process_normal_queue(self):
267267
# send batched system-level notifications (one message per system per notification type)
268268
for (inventory_id, org_id, display_name, notif_event), events in system_notif_batch.items():
269269
self._send_kafka_notif(org_id, inventory_id, display_name, notif_event.value, events, loop=self.loop)
270-
LOGGER.info("Sending system notification %s for inventory %s (%s CVEs)", notif_event.value, inventory_id, len(events))
270+
LOGGER.info("Sent %s, inventory_id=%s, cve_count=%s", notif_event.value, inventory_id, len(events))
271271
SENT_NOTIFICATIONS.inc()
272272

273273
async def _process_unknown_queue(self):

0 commit comments

Comments
 (0)