(self, shared_data)
| 17 | |
| 18 | class PushoverService: |
| 19 | """Push-notification dispatcher (historical name kept for its many callers). |
| 20 | |
| 21 | send() fans each message out to every configured channel — Pushover and/or |
| 22 | a Slack incoming webhook — so all alert sources reach both.""" |
| 23 | |
| 24 | def __init__(self, shared_data): |
| 25 | self.shared_data = shared_data |
| 26 | self._lock = threading.Lock() |
| 27 | # Tracks already-notified items to avoid spamming |
| 28 | self._notified_devices = set() # set of IPs ever notified (persisted across restarts via DB load) |
| 29 | self._offline_devices = set() # IPs that went offline this session (for back-online detection) |
| 30 | self._last_notified_vuln_count = 0 # last count we sent a vuln alert for |
| 31 | self._notified_creds = 0 # last known cred count |
| 32 | self._last_send_ts = 0.0 # rate-limit: min 2 s between sends |
| 33 | self._startup_ts = time.time() # suppress device notifications shortly after restart |
nothing calls this directly
no test coverage detected