MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / __init__

Method __init__

pushover_service.py:19–30  ·  view source on GitHub ↗
(self, shared_data)

Source from the content-addressed store, hash-verified

17
18class 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

Callers

nothing calls this directly

Calls 2

setFunction · 0.50

Tested by

no test coverage detected