mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Merge pull request #2319 from mini-bomba/segment_fetching_try_finally
Actually remove rejected promises from the pendingList
This commit is contained in:
@@ -37,8 +37,12 @@ export async function getSegmentsForVideo(videoID: VideoID, ignoreCache: boolean
|
||||
const pendingData = fetchSegmentsForVideo(videoID);
|
||||
pendingList[videoID] = pendingData;
|
||||
|
||||
const result = await pendingData;
|
||||
delete pendingList[videoID];
|
||||
let result: Awaited<typeof pendingData>;
|
||||
try {
|
||||
result = await pendingData;
|
||||
} finally {
|
||||
delete pendingList[videoID];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user