update code level

This commit is contained in:
lychang
2026-03-25 18:31:11 +08:00
parent b7118bd4b9
commit f6c9141449
10 changed files with 962 additions and 102 deletions

View File

@@ -7,6 +7,7 @@ pub struct Config {
pub database: DatabaseConfig,
pub server: ServerConfig,
pub storage: StorageConfig,
pub queue: QueueConfig,
}
@@ -27,6 +28,14 @@ pub struct StorageConfig {
pub thumbnails_dir: PathBuf,
}
#[derive(Debug, Deserialize, Clone)]
pub struct QueueConfig {
pub max_concurrent_tasks: usize,
pub queue_size_limit: usize,
pub high_request_rate_threshold: f64,
pub idle_request_rate_threshold: f64,
}
impl Config {
pub fn load() -> Result<Self, config::ConfigError> {
let config = config::Config::builder()