mirror of
https://github.com/immich-app/immich.git
synced 2025-12-29 17:25:00 +03:00
feat: PreloadManager - improve perf and standardize preloading behevior
fix test
This commit is contained in:
@@ -50,4 +50,13 @@ export class InvocationTracker {
|
||||
isActive() {
|
||||
return this.invocationsStarted !== this.invocationsEnded;
|
||||
}
|
||||
|
||||
async invoke<T>(invocable: () => Promise<T>) {
|
||||
const invocation = this.startInvocation();
|
||||
try {
|
||||
return await invocable();
|
||||
} finally {
|
||||
invocation.endInvocation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user