Skip to content

Commit a7a99ee

Browse files
committed
feat(plex): Add reasonable timeout to cache calls
1 parent bad960d commit a7a99ee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/sources/PlexApiSource.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ ${JSON.stringify(obj)}`);
534534
}
535535

536536
try {
537+
const signal = AbortSignal.timeout(5000); // reasonable 5s timeout
538+
537539
// The current version of plexjs (0.39.0) does not return the GUID
538540
// fields, so we make the call manually.
539541
const request = await this.httpClient.request(
@@ -545,6 +547,7 @@ ${JSON.stringify(obj)}`);
545547
"X-Plex-Token": this.config.data.token,
546548
"Accept": "application/json",
547549
},
550+
signal
548551
}
549552
)
550553
);

0 commit comments

Comments
 (0)