fix: use tauri runtime spawn for background services

This commit is contained in:
thibaud-leclere 2026-04-14 10:14:14 +02:00
parent 7983cfb405
commit 0e0ad80d90
2 changed files with 2 additions and 2 deletions

View file

@ -354,7 +354,7 @@ async fn process_ticket(db: &Arc<Mutex<Connection>>, app_handle: &AppHandle) ->
} }
pub fn start(db: Arc<Mutex<Connection>>, app_handle: AppHandle) { pub fn start(db: Arc<Mutex<Connection>>, app_handle: AppHandle) {
tokio::spawn(async move { tauri::async_runtime::spawn(async move {
let mut tick = interval(Duration::from_secs(10)); let mut tick = interval(Duration::from_secs(10));
loop { loop {
tick.tick().await; tick.tick().await;

View file

@ -14,7 +14,7 @@ pub fn start(
http_client: reqwest::Client, http_client: reqwest::Client,
app_handle: AppHandle, app_handle: AppHandle,
) { ) {
tokio::spawn(async move { tauri::async_runtime::spawn(async move {
let mut tick = interval(Duration::from_secs(60)); let mut tick = interval(Duration::from_secs(60));
loop { loop {
tick.tick().await; tick.tick().await;