From 91b24f0e24a3dd047e300bebbeff6ba309ea8e43 Mon Sep 17 00:00:00 2001 From: Garvit Khatri Date: Thu, 16 Jan 2025 14:52:53 +0000 Subject: [PATCH] Fix when opsToBundle.length is 0 --- src/executor/executorManager.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/executor/executorManager.ts b/src/executor/executorManager.ts index 68d0935d..1124e8bc 100644 --- a/src/executor/executorManager.ts +++ b/src/executor/executorManager.ts @@ -124,15 +124,13 @@ export class ExecutorManager { const opsToBundle = await this.getOpsToBundle() - if (opsToBundle.length === 0) { - return - } + if (opsToBundle.length > 0) { + const opsCount: number = opsToBundle.length + const timestamp: number = Date.now() + this.opsCount.push(...Array(opsCount).fill(timestamp)) // Add timestamps for each task - const opsCount: number = opsToBundle.length - const timestamp: number = Date.now() - this.opsCount.push(...Array(opsCount).fill(timestamp)) // Add timestamps for each task - - await this.bundle(opsToBundle) + await this.bundle(opsToBundle) + } const rpm: number = this.opsCount.length // Calculate next interval with linear scaling