fix(outbox) : retry temporary worker connection failures
This commit is contained in:
@@ -74,7 +74,15 @@ async function run(): Promise<void> {
|
||||
}
|
||||
|
||||
try {
|
||||
await run();
|
||||
while (!stopping) {
|
||||
try {
|
||||
await run();
|
||||
} catch (cause) {
|
||||
console.error("Outbox worker failed; retrying in 5 seconds", cause);
|
||||
await Promise.all([closeDb(), closeRedisClient()]);
|
||||
if (!stopping) await wait(5_000);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
await Promise.all([closeDb(), closeRedisClient()]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user