LBRYFoundation / Watch-on-LBRY

Plugin for web browser that automatic check if YouTube video is on LBRY
GNU General Public License v3.0
78 stars 19 forks source link

Added timeout to resolver API request #129

Closed DeepDoge closed 2 years ago

DeepDoge commented 2 years ago

When one of the APIs is down, for example Madiator Finder API, even if i change it to Odysee API from settings, it doesnt take effect for a long while.

Because if we get multiple requests with the same parameters while the first one is still running, instead of running the request function multiple times, we just run it once, and send the same result to all promises.

So even if i change the resolver API to Odysee from settings, it waits until the first Finder API request timeouts.

So it stucks for a while, so I added 5 seconds timeout.