Update repo repeatedly
This commit is contained in:
parent
0a555dd9b4
commit
980e84b0f6
5 changed files with 72 additions and 24 deletions
19
src/update.rs
Normal file
19
src/update.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//! Repeatedly update the db from the repo.
|
||||
|
||||
use tracing::{warn, debug};
|
||||
|
||||
use crate::state::AppState;
|
||||
|
||||
async fn update_repo(state: &AppState) -> anyhow::Result<()> {
|
||||
debug!("Updating repo");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn repeatedly(state: AppState) {
|
||||
loop {
|
||||
if let Err(e) = update_repo(&state).await {
|
||||
warn!("Error while updating repo: {e:?}");
|
||||
}
|
||||
tokio::time::sleep(state.config.repo_update_delay).await;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue