tenant deletion/reset
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user