redux of the worker queue
CI / check (push) Failing after 22s
CI / docker (push) Has been skipped

This commit is contained in:
Connor Johnstone
2026-03-23 18:37:46 -04:00
parent 57a8b7eee4
commit 314400bde5
6 changed files with 10 additions and 17 deletions
+5 -12
View File
@@ -14,6 +14,7 @@ use shanty_search::MusicBrainzSearch;
use shanty_web::routes; use shanty_web::routes;
use shanty_web::state::AppState; use shanty_web::state::AppState;
use shanty_web::tasks::TaskManager; use shanty_web::tasks::TaskManager;
use shanty_web::workers::WorkerManager;
#[derive(Parser)] #[derive(Parser)]
#[command(name = "shanty", about = "Shanty — self-hosted music management")] #[command(name = "shanty", about = "Shanty — self-hosted music management")]
@@ -128,21 +129,13 @@ async fn main() -> anyhow::Result<()> {
config: std::sync::Arc::new(tokio::sync::RwLock::new(config)), config: std::sync::Arc::new(tokio::sync::RwLock::new(config)),
config_path, config_path,
tasks: TaskManager::new(), tasks: TaskManager::new(),
workers: WorkerManager::new(),
firefox_login: tokio::sync::Mutex::new(None), firefox_login: tokio::sync::Mutex::new(None),
scheduler: tokio::sync::Mutex::new(shanty_web::state::SchedulerInfo {
next_pipeline: None,
next_monitor: None,
skip_pipeline: false,
skip_monitor: false,
}),
}); });
// Start background cookie refresh task // Start work queue workers and unified scheduler
shanty_web::cookie_refresh::spawn(state.config.clone()); WorkerManager::spawn_all(state.clone());
shanty_web::scheduler::spawn(state.clone());
// Start pipeline and monitor schedulers
shanty_web::pipeline_scheduler::spawn(state.clone());
shanty_web::monitor::spawn(state.clone());
shanty_web::mb_update::spawn(state.clone()); shanty_web::mb_update::spawn(state.clone());
// Resolve static files directory // Resolve static files directory