mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
28 lines
693 B
TypeScript
28 lines
693 B
TypeScript
import { Hour } from "@shared/utils/time";
|
|
import teamPermanentDeleter from "@server/commands/teamPermanentDeleter";
|
|
import { Team } from "@server/models";
|
|
import { BaseTask, TaskPriority } from "./base/BaseTask";
|
|
|
|
type Props = {
|
|
/** The team ID to permanantly destroy */
|
|
teamId: string;
|
|
};
|
|
|
|
export default class CleanupDeletedTeamTask extends BaseTask<Props> {
|
|
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,
|
|
timeout: Hour.ms,
|
|
};
|
|
}
|
|
}
|