feat(recov. job): add drive consistency service

This commit is contained in:
Edouard Vanbelle
2026-07-29 00:16:18 +02:00
parent b343ab5e0e
commit 394708c9a1
10 changed files with 975 additions and 6 deletions
+15
View File
@@ -1274,6 +1274,21 @@ impl AppServiceFactory {
.register(&core.job_registry)
.await;
// First recoverable-run tenant (`docs/plan/job-registry.md`
// Part 2). Iterates `storage.drives` and reports each drive
// whose cached `used_bytes` differs from `SUM(files.size)`.
// On-demand only — read-only diagnostic, not periodic.
// Runs on the maintenance pool alongside the other sweeps.
let job_store_provider_dyn: Arc<dyn crate::infrastructure::scheduler::JobStoreProvider> =
core.job_store_provider.clone();
let _ = Arc::new(
crate::infrastructure::services::drives_consistency_service::DrivesConsistencyCheck::new(
maintenance_pool.clone(),
),
)
.register_recoverable_job(&core.job_registry, &job_store_provider_dyn)
.await;
// 2. Repository services (requires PgPool for all metadata)
let repos = self.create_repository_services(&core, &pool);