From 580791481063f199a62c17c6e2ef902f67a6ff33 Mon Sep 17 00:00:00 2001 From: Ada Bohm Date: Thu, 12 Sep 2024 07:36:04 +0200 Subject: [PATCH] Serialize journal time stamp as number (not as a datetime string) --- crates/hyperqueue/src/server/event/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/hyperqueue/src/server/event/mod.rs b/crates/hyperqueue/src/server/event/mod.rs index 97b084648..5dc5a7fc9 100644 --- a/crates/hyperqueue/src/server/event/mod.rs +++ b/crates/hyperqueue/src/server/event/mod.rs @@ -3,6 +3,7 @@ pub mod payload; pub mod streamer; use bincode::Options; +use chrono::serde::ts_milliseconds; use chrono::{DateTime, Utc}; use payload::EventPayload; use serde::{Deserialize, Serialize}; @@ -11,6 +12,7 @@ pub type EventId = u32; #[derive(Serialize, Deserialize, Debug, Clone)] pub struct Event { + #[serde(with = "ts_milliseconds")] pub time: DateTime, pub payload: EventPayload, }