chore: Move some tasks to background priority

This commit is contained in:
Tom Moor
2024-03-19 18:57:15 -04:00
parent 5248c95211
commit e2c8678855
2 changed files with 14 additions and 2 deletions

View File

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

View File

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