Skip to content

Commit f9d3600

Browse files
author
dasman
committed
evgrd: update to fully use millis
1 parent b6797fa commit f9d3600

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

script/evgrd/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
use darkfi::{
2020
event_graph::{
21-
util::{generate_genesis, next_rotation_timestamp, seconds_until_next_rotation},
21+
util::{generate_genesis, millis_until_next_rotation, next_rotation_timestamp},
2222
Event, GENESIS_CONTENTS, INITIAL_GENESIS, NULL_ID, N_EVENT_PARENTS,
2323
},
24-
system::{sleep, Publisher, PublisherPtr, StoppableTask, StoppableTaskPtr},
24+
system::{msleep, Publisher, PublisherPtr, StoppableTask, StoppableTaskPtr},
2525
Error, Result,
2626
};
2727
use darkfi_serial::{
@@ -173,7 +173,7 @@ impl LocalEventGraph {
173173

174174
loop {
175175
// Find the next rotation timestamp:
176-
let next_rotation = next_rotation_timestamp(INITIAL_GENESIS / 1000, days_rotation);
176+
let next_rotation = next_rotation_timestamp(INITIAL_GENESIS, days_rotation);
177177

178178
// Prepare the new genesis event
179179
let current_genesis = Event {
@@ -184,10 +184,10 @@ impl LocalEventGraph {
184184
};
185185

186186
// Sleep until it's time to rotate.
187-
let s = seconds_until_next_rotation(next_rotation);
187+
let s = millis_until_next_rotation(next_rotation);
188188

189189
debug!(target: "event_graph::dag_prune_task()", "Sleeping {}s until next DAG prune", s);
190-
sleep(s).await;
190+
msleep(s).await;
191191
debug!(target: "event_graph::dag_prune_task()", "Rotation period reached");
192192

193193
// Trigger DAG prune

0 commit comments

Comments
 (0)