feat: implement request monitoring and queuing services to manage concurrent requests to Komga

This commit is contained in:
Julien Froidefond
2025-10-14 20:20:02 +02:00
parent 5afb495cd4
commit b954a271d6
11 changed files with 6648 additions and 4688 deletions

View File

@@ -12,7 +12,7 @@ export class ImageService extends BaseApiService {
try {
const headers = { Accept: "image/jpeg, image/png, image/gif, image/webp, */*" };
return this.fetchWithCache<ImageResponse>(
const result = await this.fetchWithCache<ImageResponse>(
`image-${path}`,
async () => {
const response = await this.fetchFromApi<Response>({ path }, headers, { isImage: true });
@@ -27,6 +27,8 @@ export class ImageService extends BaseApiService {
},
"IMAGES"
);
return result;
} catch (error) {
console.error("Erreur lors de la récupération de l'image:", error);
throw new AppError(ERROR_CODES.IMAGE.FETCH_ERROR, {}, error);