chore: Move some tasks to background priority
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Logger from "@server/logging/Logger";
|
||||
import { WebhookSubscription, ApiKey, User } from "@server/models";
|
||||
import { sequelize } from "@server/storage/database";
|
||||
import BaseTask from "./BaseTask";
|
||||
import BaseTask, { TaskPriority } from "./BaseTask";
|
||||
|
||||
type Props = {
|
||||
userId: string;
|
||||
@@ -54,4 +54,10 @@ export default class CleanupDemotedUserTask extends BaseTask<Props> {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public get options() {
|
||||
return {
|
||||
priority: TaskPriority.Background,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Attachment } from "@server/models";
|
||||
import BaseTask from "./BaseTask";
|
||||
import BaseTask, { TaskPriority } from "./BaseTask";
|
||||
|
||||
type Props = {
|
||||
teamId: string;
|
||||
@@ -21,4 +21,10 @@ export default class DeleteAttachmentTask extends BaseTask<Props> {
|
||||
|
||||
await attachment.destroy();
|
||||
}
|
||||
|
||||
public get options() {
|
||||
return {
|
||||
priority: TaskPriority.Background,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user