You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
634 B
Rust
28 lines
634 B
Rust
use crate::jobs::{EmptyStatus, Job};
|
|
use async_trait::async_trait;
|
|
use mediarepo_core::error::RepoResult;
|
|
use mediarepo_logic::dao::repo::Repo;
|
|
use mediarepo_logic::dao::DaoProvider;
|
|
use std::sync::Arc;
|
|
use tokio::sync::RwLock;
|
|
|
|
#[derive(Default, Clone)]
|
|
pub struct VacuumJob;
|
|
|
|
#[async_trait]
|
|
impl Job for VacuumJob {
|
|
type JobStatus = ();
|
|
type Result = ();
|
|
|
|
fn status(&self) -> Arc<RwLock<Self::JobStatus>> {
|
|
EmptyStatus::default()
|
|
}
|
|
|
|
#[tracing::instrument(level = "debug", skip_all)]
|
|
async fn run(&self, repo: Arc<Repo>) -> RepoResult<()> {
|
|
repo.job().vacuum().await?;
|
|
|
|
Ok(())
|
|
}
|
|
}
|