mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(api): ⚡ Move media processing to background job
This commit is contained in:
parent
dcdc8c7365
commit
80b874e5fb
12 changed files with 242 additions and 119 deletions
15
classes/queues/media.ts
Normal file
15
classes/queues/media.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { Queue } from "bullmq";
|
||||
import { connection } from "~/utils/redis.ts";
|
||||
|
||||
export enum MediaJobType {
|
||||
ConvertMedia = "convertMedia",
|
||||
}
|
||||
|
||||
export type MediaJobData = {
|
||||
attachmentId: string;
|
||||
filename: string;
|
||||
};
|
||||
|
||||
export const mediaQueue = new Queue<MediaJobData, void, MediaJobType>("media", {
|
||||
connection,
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue