mirror of
https://github.com/outline/outline.git
synced 2026-11-28 08:14:58 +03:00
* fix: Spelling, grammar, punctuation, and translation string errors * fix: Remove duplicate period and comma splice from review feedback
30 lines
707 B
TypeScript
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,
|
|
};
|
|
}
|
|
}
|