From 8754f9c2f0c8c4a4e3be457933e9f09d683ba084 Mon Sep 17 00:00:00 2001 From: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com> Date: Sat, 14 Feb 2026 20:36:53 +0100 Subject: [PATCH] Route scheduled balance monitoring through QueueHandler processScheduledBalanceMonitoring() was calling processBalances() and processChannels() directly, bypassing the QueueHandler used by the webhook-triggered processBalanceMonitoring(). This could cause race conditions when both paths run concurrently. Use processBalanceMonitoring() instead, which serializes all balance processing through the existing QueueHandler. --- src/subdomains/monitoring/services/monitoring.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/subdomains/monitoring/services/monitoring.service.ts b/src/subdomains/monitoring/services/monitoring.service.ts index dabdd7e95..4c9b61d0b 100644 --- a/src/subdomains/monitoring/services/monitoring.service.ts +++ b/src/subdomains/monitoring/services/monitoring.service.ts @@ -79,8 +79,7 @@ export class MonitoringService implements OnModuleInit { const internalBalances = await this.lightingWalletRepository.getInternalBalances(internalWalletIds); const customerBalances = await this.lightingWalletRepository.getCustomerBalances(internalWalletIds); - await this.processBalances(internalBalances, customerBalances); - await this.processChannels(); + await this.processBalanceMonitoring(internalBalances, customerBalances); } catch (e) { this.logger.error('Error during scheduled balance monitoring', e); }