refactor: replace unmaintained chrono with time (RUSTSEC-2026-0543)
Adds a timeutil module (unix_now, is_valid_unix, RFC 3339 format/parse) and moves ClickHouse event timestamps to time::serde::rfc3339. cargo deny is green again.
This commit is contained in:
parent
f25dc3558a
commit
e2adf8601c
19 changed files with 74 additions and 128 deletions
|
|
@ -7,7 +7,7 @@ use rampart::store::clickhouse::{ClickHouseEvent, ClickHouseWriter, MAX_BUFFER_E
|
|||
|
||||
fn event(seq: usize) -> ClickHouseEvent {
|
||||
ClickHouseEvent {
|
||||
timestamp: chrono::Utc::now(),
|
||||
timestamp: time::OffsetDateTime::now_utc(),
|
||||
event_type: "test".to_string(),
|
||||
ip: format!("192.0.2.{}", seq % 250),
|
||||
data_float: 0.0,
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@
|
|||
use rampart::manager::sync::heartbeat::{NODES_KEY_PATTERN, offline_update};
|
||||
|
||||
fn rfc3339(ts: i64) -> String {
|
||||
chrono::DateTime::from_timestamp(ts, 0)
|
||||
.expect("in-range timestamp")
|
||||
.to_rfc3339()
|
||||
rampart::timeutil::format_rfc3339(ts).expect("in-range timestamp")
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue