redux of the worker queue
This commit is contained in:
+5
-12
@@ -14,6 +14,7 @@ use shanty_search::MusicBrainzSearch;
|
||||
use shanty_web::routes;
|
||||
use shanty_web::state::AppState;
|
||||
use shanty_web::tasks::TaskManager;
|
||||
use shanty_web::workers::WorkerManager;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[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_path,
|
||||
tasks: TaskManager::new(),
|
||||
workers: WorkerManager::new(),
|
||||
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
|
||||
shanty_web::cookie_refresh::spawn(state.config.clone());
|
||||
|
||||
// Start pipeline and monitor schedulers
|
||||
shanty_web::pipeline_scheduler::spawn(state.clone());
|
||||
shanty_web::monitor::spawn(state.clone());
|
||||
// Start work queue workers and unified scheduler
|
||||
WorkerManager::spawn_all(state.clone());
|
||||
shanty_web::scheduler::spawn(state.clone());
|
||||
shanty_web::mb_update::spawn(state.clone());
|
||||
|
||||
// Resolve static files directory
|
||||
|
||||
Reference in New Issue
Block a user