fix gen_range
This commit is contained in:
parent
9ca84266d9
commit
0d57d28a3c
1 changed files with 1 additions and 3 deletions
|
@ -216,9 +216,7 @@ async fn persister(id: String, rustpad: Arc<Rustpad>, db: Database) {
|
|||
let mut last_revision = 0;
|
||||
while !rustpad.killed() {
|
||||
let interval = PERSIST_INTERVAL
|
||||
+ Duration::from_millis(
|
||||
rand::thread_rng().gen_range(0..=PERSIST_INTERVAL_JITTER.as_millis() as u64),
|
||||
);
|
||||
+ rand::thread_rng().gen_range(Duration::ZERO..=PERSIST_INTERVAL_JITTER);
|
||||
time::sleep(interval).await;
|
||||
let revision = rustpad.revision();
|
||||
if revision > last_revision {
|
||||
|
|
Loading…
Add table
Reference in a new issue