Files
outline/server/queues/tasks/CleanupDeletedTeamTask.ts
T
Tom Moor e571208871 fix: Spelling, grammar, punctuation, and translation string errors (#14017)
* fix: Spelling, grammar, punctuation, and translation string errors

* fix: Remove duplicate period and comma splice from review feedback
2026-10-11 09:07:07 -04:00

30 lines
707 B
TypeScript

import teamPermanentDeleter from "@server/commands/teamPermanentDeleter";
import { Team } from "@server/models";
import { BaseTask, TaskPriority } from "./base/BaseTask";
type Props = {
/** The team ID to permanently destroy */
teamId: string;
};
export default class CleanupDeletedTeamTask extends BaseTask<Props> {
protected jobId({ teamId }: Props) {
return `cleanup-team:${teamId}`;
}
public async perform({ teamId }: Props) {
const team = await Team.findByPk(teamId, {
paranoid: false,
rejectOnEmpty: true,
});
await teamPermanentDeleter(team);
}
public get options() {
return {
attempts: 1,
priority: TaskPriority.Background,
};
}
}