style(downloads): Added GAME_PAUSE_CHECK_INTERVAL value

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-11-09 20:00:05 +11:00
parent 2c7b5fb47d
commit 8204795ba6
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
use crate::auth::generate_authorization_header; use crate::{auth::generate_authorization_header, GAME_PAUSE_CHECK_INTERVAL};
use crate::db::DatabaseImpls; use crate::db::DatabaseImpls;
use crate::downloads::manifest::DropDownloadContext; use crate::downloads::manifest::DropDownloadContext;
use crate::DB; use crate::DB;
@ -78,7 +78,7 @@ impl DropFileWriter {
} }
GameDownloadState::Paused => { GameDownloadState::Paused => {
info!("Game download paused"); info!("Game download paused");
sleep(Duration::from_secs(1)); sleep(GAME_PAUSE_CHECK_INTERVAL);
} }
}; };
None None

View File

@ -19,12 +19,15 @@ use log::info;
use remote::{gen_drop_url, use_remote}; use remote::{gen_drop_url, use_remote};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration;
use std::{ use std::{
collections::HashMap, collections::HashMap,
sync::{LazyLock, Mutex}, sync::{LazyLock, Mutex},
}; };
use tauri_plugin_deep_link::DeepLinkExt; use tauri_plugin_deep_link::DeepLinkExt;
pub const GAME_PAUSE_CHECK_INTERVAL: Duration = Duration::from_secs(1);
#[derive(Clone, Copy, Serialize)] #[derive(Clone, Copy, Serialize)]
pub enum AppStatus { pub enum AppStatus {
NotConfigured, NotConfigured,