Reinstate backoffs on startup
ci/woodpecker/push/manual Pipeline is pending Details
ci/woodpecker/push/check Pipeline was successful Details
ci/woodpecker/push/release Pipeline was successful Details

This commit is contained in:
Olivier 'reivilibre' 2022-06-10 23:35:24 +01:00
parent fc69b1b192
commit bb396dfb5b
1 changed files with 10 additions and 1 deletions

View File

@ -14,7 +14,7 @@ use signal_hook::iterator::Signals;
use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex, RwLock};
use std::time::Duration;
use std::time::{Duration, SystemTime};
use tokio::fs::File;
use tokio::sync::{mpsc, oneshot, Notify, Semaphore};
use tokio::time::MissedTickBehavior;
@ -270,6 +270,15 @@ pub async fn main() -> anyhow::Result<()> {
notify: graceful_stop_notify,
};
// Reinstate old backoffs
store
.async_rw_txn(|txn| {
txn.reinstate_backoffs(SystemTime::now())?;
txn.commit()?;
Ok(())
})
.await?;
let mut tasks = Vec::with_capacity(num_tasks as usize);
for task_num in 0..num_tasks {