mirror of
https://github.com/immich-app/immich.git
synced 2026-03-23 13:19:46 +03:00
fix: metadata crash (#26327)
This commit is contained in:
13
server/src/utils/tasks.ts
Normal file
13
server/src/utils/tasks.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export type Task = () => Promise<unknown> | unknown;
|
||||
|
||||
export class Tasks {
|
||||
private tasks: Task[] = [];
|
||||
|
||||
push(...tasks: Task[]) {
|
||||
this.tasks.push(...tasks);
|
||||
}
|
||||
|
||||
async all() {
|
||||
await Promise.all(this.tasks.map((item) => item()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user