first commit
This commit is contained in:
19
backend/app/repositories/native/system_events.py
Normal file
19
backend/app/repositories/native/system_events.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Sequence
|
||||
|
||||
from app.domain.observability import SystemEvent
|
||||
|
||||
|
||||
class SystemEventRepository:
|
||||
"""Temporary event repository for runtime/system telemetry."""
|
||||
|
||||
_events: list[SystemEvent] = []
|
||||
|
||||
async def add(self, event: SystemEvent) -> SystemEvent:
|
||||
self._events.append(event)
|
||||
return event
|
||||
|
||||
async def list_recent(self, limit: int = 100) -> Sequence[SystemEvent]:
|
||||
return self._events[-limit:]
|
||||
|
||||
Reference in New Issue
Block a user