Skip to content

Commit

Permalink
backend: Improved logs
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Jun 28, 2024
1 parent 81e50a0 commit 472eb4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openvidu-call-back/src/services/OpenViduService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,15 @@ export class OpenViduService {
await session.fetch();
return session;
} catch (error) {
console.log('Error creating session: ', error);
const status = error.message;
if ((status >= 500 && status <= 504) || status == 404) {
// Retry is used for OpenVidu Enterprise High Availability for reconnecting purposes
// to allow fault tolerance
// 502 to 504 are returned when OpenVidu Server is not available (stopped, not reachable, etc...)
// 404 is returned when the session does not exist which is returned by fetch operation in createSession
// and it is not a possible error after session creation
console.log('Error creating session: ', status, 'Retrying session creation...', retryOptions);
console.log('Error creating session: ', status, 'Retrying session creation...');
await retryOptions.retrySleep();
} else {
console.log("Unknown error creating session: ", error);
Expand Down

0 comments on commit 472eb4d

Please sign in to comment.