feat: add periodic update check every 6 hours to ensure app is up to date

This commit is contained in:
Kiril Videlov 2024-01-24 17:28:52 +01:00 committed by Kiril Videlov
parent 04db6b7da1
commit 4b55839fce

View File

@ -66,6 +66,14 @@ fn main() {
#[cfg(debug_assertions)]
window.open_devtools();
tokio::task::spawn(async move {
let mut six_hours = tokio::time::interval(tokio::time::Duration::new(6 * 60 * 60, 0));
loop {
six_hours.tick().await;
_ = window.emit_and_trigger("tauri://update", ());
}
});
let app_handle = tauri_app.handle();
logs::init(&app_handle);