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

Function _rusense_pushover

webapp_modern.py:847–858  ·  view source on GitHub ↗

Return the shared PushoverService, creating it once if needed.

()

Source from the content-addressed store, hash-verified

845 tmp = f"{path}.tmp"
846 with open(tmp, 'w') as fh:
847 json.dump(lst, fh)
848 os.replace(tmp, path)
849 except OSError as exc:
850 logger.error(f"[rusense] failed to persist vitals history: {exc}")
851
852
853def _rusense_vitals_record(now, vs, present):
854 """Fold one ~1 Hz notify pass into the current 5-min bucket; when the
855 bucket rolls over, compact the finished one into the persisted history.
856 Every pass contributes to the activity duty; HR/BR contribute only at
857 display-grade confidence (>= 0.3 — below that the engine is guessing).
858 A restart loses at most the one in-progress bucket."""
859 bucket_t = int(now - (now % _RUSENSE_VITALS_BUCKET_S))
860 with _rusense_vitals_lock:
861 cur = _rusense_notify_state.get('vitals_bucket')

Callers 1

_rusense_check_onceFunction · 0.85

Calls 2

PushoverServiceClass · 0.90
debugMethod · 0.80

Tested by

no test coverage detected