fix(metadata): adjust timeouts

This commit is contained in:
Viren070
2025-09-26 22:36:21 +01:00
parent bd05313888
commit 7ec4774151
4 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -271,7 +271,7 @@ export class MetadataService {
};
},
{
timeout: 2500, // metadata does not take long to fetch so keep it low
timeout: 5000,
ttl: 5000,
retryInterval: 100,
}
+5 -5
View File
@@ -164,7 +164,7 @@ export class TMDBMetadata {
url.searchParams.set('external_source', `${IdTypeMap[parsedId.type]}`);
this.addSearchParams(url);
const response = await makeRequest(url.toString(), {
timeout: 10000,
timeout: 2000,
headers: this.getHeaders(),
});
@@ -222,7 +222,7 @@ export class TMDBMetadata {
);
this.addSearchParams(detailsUrl);
const detailsResponse = await makeRequest(detailsUrl.toString(), {
timeout: 10000,
timeout: 2000,
headers: this.getHeaders(),
});
@@ -278,7 +278,7 @@ export class TMDBMetadata {
const [altTitlesResult, translationsResult] = await Promise.allSettled([
makeRequest(altTitlesUrl.toString(), {
timeout: 10000,
timeout: 2000,
headers: this.getHeaders(),
}).then(async (response) => {
if (!response.ok) {
@@ -300,7 +300,7 @@ export class TMDBMetadata {
);
}),
makeRequest(translatedTitlesUrl.toString(), {
timeout: 10000,
timeout: 2000,
headers: this.getHeaders(),
}).then(async (response) => {
if (!response.ok) {
@@ -379,7 +379,7 @@ export class TMDBMetadata {
const url = new URL(API_BASE_URL + '/authentication');
this.addSearchParams(url);
const validationResponse = await makeRequest(url.toString(), {
timeout: 10000,
timeout: 2000,
headers: this.getHeaders(),
});
if (!validationResponse.ok) {
+1 -1
View File
@@ -49,7 +49,7 @@ export async function getTraktAliases(
const data = await makeRequest(
`${TRAKT_API_BASE_URL}/${parsedId.mediaType === 'movie' ? 'movies' : 'shows'}/${imdbId}/aliases`,
{
timeout: 1000,
timeout: 2000,
headers: {
'Content-Type': 'application/json',
'trakt-api-version': '1',
+4
View File
@@ -283,6 +283,7 @@ class TVDBApi {
{
schema: AuthTokenSchema,
method: 'POST',
timeout: 2000,
body: {
apikey: this.apiKey,
},
@@ -314,6 +315,7 @@ class TVDBApi {
`/search/remoteid/${remoteId}`,
{
schema: RemoteIdSearchResponseSchema,
timeout: 2000,
}
);
},
@@ -332,6 +334,7 @@ class TVDBApi {
`/series/${id}`,
{
schema: SeriesResponseSchema,
timeout: 2000,
}
);
},
@@ -350,6 +353,7 @@ class TVDBApi {
`/movies/${id}`,
{
schema: MovieResponseSchema,
timeout: 2000,
}
);
},