Skip to content

Commit fc00e1b

Browse files
committed
🚑 Try fixing general queuing
1 parent d4a3ff3 commit fc00e1b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/webtoon/webtoon/download-manager.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ export class DownloadManagerService{
7070
throw new HttpException("Cache not loaded.", HttpStatusCode.TooEarly);
7171
for(const webtoonLanguageName of await this.webtoonDatabaseService.getWebtoonList()){
7272
const webtoonLanguage: CachedWebtoonModel[] = this.webtoonParserService.webtoons[webtoonLanguageName.language];
73+
if(!webtoonLanguage){
74+
this.logger.debug(`Language ${webtoonLanguageName.language} not found in cache. Skipping...`);
75+
continue;
76+
}
7377
this.downloadQueue.enqueue(webtoonLanguage.find(w => w.title === webtoonLanguageName.title) as CachedWebtoonModel);
7478
}
7579
if(!this.downloadQueue.getCurrentDownload())
@@ -103,7 +107,7 @@ export class DownloadManagerService{
103107
try{
104108
epImageLinks = await this.webtoonParserService.getEpisodeLinks(this.downloadQueue.getCurrentDownload(), epList[i]);
105109
fetched = true;
106-
}catch (_: any){
110+
}catch(_: any){
107111
this.logger.warn(`Error fetching episode ${epList[i].number} of ${this.downloadQueue.getCurrentDownload().title}. Retrying...`);
108112
await new Promise(resolve => setTimeout(resolve, 3000));
109113
}

0 commit comments

Comments
 (0)