mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +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);
|
const pendingData = fetchSegmentsForVideo(videoID);
|
||||||
pendingList[videoID] = pendingData;
|
pendingList[videoID] = pendingData;
|
||||||
|
|
||||||
const result = await pendingData;
|
let result: Awaited<typeof pendingData>;
|
||||||
delete pendingList[videoID];
|
try {
|
||||||
|
result = await pendingData;
|
||||||
|
} finally {
|
||||||
|
delete pendingList[videoID];
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user