implement duration specifier for history

This commit is contained in:
csehviktor
2025-07-15 01:34:27 +02:00
parent 6a311246f6
commit 6eb696019a
5 changed files with 68 additions and 14 deletions
+5 -1
View File
@@ -65,7 +65,11 @@ impl TryFrom<&Row<'_>> for UptimeStorageModel {
pub trait StorageRepository: Send + Sync {
async fn record_message(&self, message: &StatusMessage) -> anyhow::Result<()>;
async fn record_uptime(&self, agent: &str) -> anyhow::Result<()>;
async fn get_history(&self, agent: &str) -> anyhow::Result<Vec<StatusMessage>>;
async fn get_history(
&self,
agent: &str,
duration: Option<DateTime<Utc>>,
) -> anyhow::Result<Vec<StatusMessage>>;
async fn get_agents(&self) -> anyhow::Result<Vec<UptimeMessage>>;
}