From 77ab18549364fe2f87457d9dc541473722a223a2 Mon Sep 17 00:00:00 2001 From: teidesu Date: Sat, 24 Apr 2021 20:13:36 +0300 Subject: [PATCH] fix(core): properly handle WORKER_BUSY_TOO_LONG_RETRY error --- packages/core/src/base-client.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/base-client.ts b/packages/core/src/base-client.ts index 4101e6a1..979974fd 100644 --- a/packages/core/src/base-client.ts +++ b/packages/core/src/base-client.ts @@ -505,6 +505,10 @@ export class BaseTelegramClient { if (e instanceof InternalError) { debug('Telegram is having internal issues: %s', e) + if (e.message === 'WORKER_BUSY_TOO_LONG_RETRY') { + // according to tdlib, "it is dangerous to resend query without timeout, so use 1" + await sleep(1000) + } continue }