From 5cdc7bcbed7d15540df334600728f7bd0691437d Mon Sep 17 00:00:00 2001 From: Thomas Bonnin <233326+TBonnin@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:08:31 -0400 Subject: [PATCH] fix: do not idle runner if idleMaxDurationMs is 0 (#1949) ## Describe your changes Introduced a bug in https://github.com/NangoHQ/nango/pull/1943/files which cause runner with max idle time set to zero like the default runner or paying customer to idle all the time. ## Checklist before requesting a review (skip if just adding/editing APIs & templates) - [ ] I added tests, otherwise the reason is: - [ ] I added observability, otherwise the reason is: - [ ] I added analytics, otherwise the reason is: --- packages/runner/lib/monitor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runner/lib/monitor.ts b/packages/runner/lib/monitor.ts index 8e01718d7e..16158e7d11 100644 --- a/packages/runner/lib/monitor.ts +++ b/packages/runner/lib/monitor.ts @@ -93,7 +93,7 @@ export class RunnerMonitor { private checkIdle(): NodeJS.Timeout { // eslint-disable-next-line @typescript-eslint/no-misused-promises return setInterval(async () => { - if (this.tracked.size == 0) { + if (this.idleMaxDurationMs > 0 && this.tracked.size == 0) { const idleTimeMs = Date.now() - this.lastIdleTrackingDate; if (idleTimeMs > this.idleMaxDurationMs) { logger.info(`Runner '${this.runnerId}' idle for more than ${this.idleMaxDurationMs}ms`);