tenant deletion/reset

This commit is contained in:
2025-11-11 12:17:24 +01:00
parent 4f29ff73c6
commit 8751637b92
15 changed files with 1015 additions and 27 deletions
+11 -2
View File
@@ -53,7 +53,16 @@ impl JobHandler for PurgeDocumentJob {
job: crate::models::Job,
storage: TenantStorage,
) -> JobExecution {
if let Err(err) = ensure_active_tenant(&state, job.tenant_id) {
let tenant_id = match job.tenant_id {
Some(id) => id,
None => {
return JobExecution::Failed {
error: "job is no longer associated with a tenant".to_string(),
}
}
};
if let Err(err) = ensure_active_tenant(&state, tenant_id) {
return JobExecution::Failed {
error: err.to_string(),
};
@@ -71,7 +80,7 @@ impl JobHandler for PurgeDocumentJob {
let mut context = PurgeTaskContext::new(
job.id,
JOB_PURGE_DOCUMENT,
job.tenant_id,
tenant_id,
payload.document_id,
state.clone(),
storage,