mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
42959d66db
* wip * Implementation complete * tidying * test * Address feedback * Remove duplicative retry logic from UpdateDocumentsPopularityScoreTask. Now that we're split across many runs this is not neccessary * Refactor to subclass, config to instance * Refactor BaseTask to named export * fix: Missing partition * tsc * Feedback
26 lines
626 B
TypeScript
26 lines
626 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 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,
|
|
};
|
|
}
|
|
}
|