refactor: move AppContext to presentation crate, structurally enforce boundary
All checks were successful
CI / Check / Test (push) Successful in 39m33s
All checks were successful
CI / Check / Test (push) Successful in 39m33s
This commit is contained in:
@@ -2,7 +2,10 @@ use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use domain::{errors::DomainError, ports::{ImportSessionRepository, PeriodicJob}};
|
||||
use domain::{
|
||||
errors::DomainError,
|
||||
ports::{ImportSessionRepository, PeriodicJob},
|
||||
};
|
||||
|
||||
pub struct ImportSessionCleanupJob {
|
||||
import_session: Arc<dyn ImportSessionRepository>,
|
||||
|
||||
@@ -2,7 +2,10 @@ use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use domain::{errors::DomainError, ports::{PeriodicJob, WatchEventRepository}};
|
||||
use domain::{
|
||||
errors::DomainError,
|
||||
ports::{PeriodicJob, WatchEventRepository},
|
||||
};
|
||||
|
||||
pub struct WatchEventCleanupJob {
|
||||
watch_event: Arc<dyn WatchEventRepository>,
|
||||
|
||||
@@ -114,10 +114,7 @@ impl PeriodicJob for WrapUpCleanupJob {
|
||||
|
||||
async fn run(&self) -> Result<(), DomainError> {
|
||||
let cutoff = chrono::Utc::now().naive_utc() - chrono::Duration::days(7);
|
||||
let n = self
|
||||
.wrapup_repo
|
||||
.delete_failed_older_than(cutoff)
|
||||
.await?;
|
||||
let n = self.wrapup_repo.delete_failed_older_than(cutoff).await?;
|
||||
if n > 0 {
|
||||
tracing::info!("wrapup cleanup: removed {n} failed records");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user