Skip to content

Commit

Permalink
Replace Promise.race with Promise.any
Browse files Browse the repository at this point in the history
  • Loading branch information
fifv authored and gmertes committed Feb 27, 2024
1 parent b12ff31 commit 67bf9b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nflxmultisubs.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class SubtitleBase {
console.debug('Selecting fastest server, candidates: ',
this.urls.map(u => u.substr(0, 24)));

return Promise.race(
return Promise.any(
this.urls.map(url => fetch(new Request(url), {method: 'HEAD'}))
).then(r => {
const url = r.url;
Expand Down

0 comments on commit 67bf9b9

Please sign in to comment.