fix: use tauri runtime spawn for background services
This commit is contained in:
parent
7983cfb405
commit
0e0ad80d90
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue