wire types: use chrono DateTime<Utc> as the timestamp type throughout
This commit is contained in:
parent
1e205289c5
commit
2c5d9ed336
15 changed files with 108 additions and 190 deletions
|
|
@ -2018,8 +2018,8 @@ fn schedule_to_wire(s: crate::scheduled_prompts::Schedule) -> hive_sh4re::WireSc
|
|||
owner: s.owner,
|
||||
body: s.body,
|
||||
interval_seconds: s.interval_seconds,
|
||||
next_fire_at_unix: hive_sh4re::wire_time::WireTime(s.next_fire_at_unix),
|
||||
created_at_unix: hive_sh4re::wire_time::WireTime(s.created_at_unix),
|
||||
next_fire_at_unix: hive_sh4re::wire_time::from_secs(s.next_fire_at_unix),
|
||||
created_at_unix: hive_sh4re::wire_time::from_secs(s.created_at_unix),
|
||||
source: match s.source {
|
||||
crate::scheduled_prompts::ScheduleSource::Operator => {
|
||||
hive_sh4re::WireScheduleSource::Operator
|
||||
|
|
@ -2028,16 +2028,16 @@ fn schedule_to_wire(s: crate::scheduled_prompts::Schedule) -> hive_sh4re::WireSc
|
|||
hive_sh4re::WireScheduleSource::Approval { id }
|
||||
}
|
||||
},
|
||||
cancelled_at_unix: s.cancelled_at_unix.map(hive_sh4re::wire_time::WireTime),
|
||||
paused_at_unix: s.paused_at_unix.map(hive_sh4re::wire_time::WireTime),
|
||||
cancelled_at_unix: s.cancelled_at_unix.map(hive_sh4re::wire_time::from_secs),
|
||||
paused_at_unix: s.paused_at_unix.map(hive_sh4re::wire_time::from_secs),
|
||||
description: s.description,
|
||||
targets: s
|
||||
.targets
|
||||
.into_iter()
|
||||
.map(|t| hive_sh4re::WireScheduleTarget {
|
||||
target: t.target,
|
||||
cancelled_at_unix: t.cancelled_at_unix.map(hive_sh4re::wire_time::WireTime),
|
||||
last_fired_at_unix: t.last_fired_at_unix.map(hive_sh4re::wire_time::WireTime),
|
||||
cancelled_at_unix: t.cancelled_at_unix.map(hive_sh4re::wire_time::from_secs),
|
||||
last_fired_at_unix: t.last_fired_at_unix.map(hive_sh4re::wire_time::from_secs),
|
||||
last_result: t.last_result,
|
||||
})
|
||||
.collect(),
|
||||
|
|
@ -2131,8 +2131,8 @@ mod tests {
|
|||
owner: "operator".to_owned(),
|
||||
body: "ping".to_owned(),
|
||||
interval_seconds: None,
|
||||
next_fire_at_unix: hive_sh4re::wire_time::WireTime(0),
|
||||
created_at_unix: hive_sh4re::wire_time::WireTime(0),
|
||||
next_fire_at_unix: hive_sh4re::wire_time::from_secs(0),
|
||||
created_at_unix: hive_sh4re::wire_time::from_secs(0),
|
||||
source: hive_sh4re::WireScheduleSource::Operator,
|
||||
cancelled_at_unix: None,
|
||||
paused_at_unix: None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue