Files
outline/server/queues/tasks/CleanupDeletedTeamTask.ts
Tom Moor 42959d66db chore: Add cron task partitioning (#10736)
* 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
2025-11-27 16:57:52 +01:00

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,
};
}
}