Skip to content

Commit

Permalink
feat: create snapshot every 30 minutes (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
chancehudson authored and sripwoud committed Dec 15, 2024
1 parent e2f5938 commit 76bd9ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ async fn main() -> Result<(), AppError> {

// only create snapshot in release mode
#[cfg(not(debug_assertions))]
create_snapshot(&DB);
tokio::spawn(async move {
loop {
create_snapshot(&DB);
// snapshot every 30 mins
sleep_seconds(1800).await;
}
});

tokio::spawn(async move {
loop {
Expand Down

0 comments on commit 76bd9ac

Please sign in to comment.