From a90dbce7ce65cc40bec657111e4aed2883fb3800 Mon Sep 17 00:00:00 2001 From: boufni95 Date: Sat, 11 Jul 2020 20:41:59 +0200 Subject: [PATCH] backups fix --- src/routes.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes.js b/src/routes.js index 35914618..53ae402c 100644 --- a/src/routes.js +++ b/src/routes.js @@ -517,7 +517,8 @@ module.exports = async ( }) stream.on("end", ()=>{ logger.info("Channel backup stream ended, starting a new one...") - onNewChannelBackup() + // Prevents call stack overflow exceptions + process.nextTick(onNewChannelBackup) }) stream.on("error", err => { logger.error("Channel backup stream error:", err); @@ -525,7 +526,9 @@ module.exports = async ( stream.on("status", status => { logger.error("Channel backup stream status:", status); if (status.code === 14) { - onNewChannelBackup(); + // Prevents call stack overflow exceptions + process.nextTick(onNewChannelBackup) + } }) }