Skip to content

Commit

Permalink
Handle slow HS response on Redaction Queue
Browse files Browse the repository at this point in the history
Retry at least once on Timeouts...
  • Loading branch information
maranda committed Aug 27, 2024
1 parent 48bd1ee commit fdd0f99
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/queues/EventRedactionQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,26 @@ export class EventRedactionQueue {
errorKind: ERROR_KIND_FATAL,
};
}
errors.push(roomError);
// if error is a timeout retry once
let timeoutRetry: boolean = false;
if (roomError.errorMessage === "ESOCKETTIMEDOUT") {
try {
await redaction.redact(client, managementRoom);
timeoutRetry = true;
} catch (e) {
if (e.roomId && e.errorMessage && e.errorKind) {
roomError.errorMessage = e.errorMessage;
roomError.errorKind = e.errorKind;
} else {
const message = e.message || (e.body ? e.body.error : '<no message>');
roomError.errorMessage = message;
roomError.errorKind = ERROR_KIND_FATAL;
}
}
}
if (!timeoutRetry) {
errors.push(roomError);
}
}
}
}
Expand Down

0 comments on commit fdd0f99

Please sign in to comment.