From b3735328b79075c508f8cb95acc2a134010c0230 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Mon, 22 Aug 2022 22:31:21 +0200 Subject: [PATCH] Await mysql queries in order to avoid deadlock --- backend/src/tasks/lightning/network-sync.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/tasks/lightning/network-sync.service.ts b/backend/src/tasks/lightning/network-sync.service.ts index d704012f7..b65fe44f1 100644 --- a/backend/src/tasks/lightning/network-sync.service.ts +++ b/backend/src/tasks/lightning/network-sync.service.ts @@ -83,7 +83,7 @@ class NetworkSyncService { logger.info(`${progress} nodes updated. ${deletedSockets} sockets deleted`); // If a channel if not present in the graph, mark it as inactive - nodesApi.$setNodesInactive(graphNodesPubkeys); + await nodesApi.$setNodesInactive(graphNodesPubkeys); if (config.MAXMIND.ENABLED) { $lookupNodeLocation(); @@ -121,7 +121,7 @@ class NetworkSyncService { logger.info(`${progress} channels updated`); // If a channel if not present in the graph, mark it as inactive - channelsApi.$setChannelsInactive(graphChannelsIds); + await channelsApi.$setChannelsInactive(graphChannelsIds); } catch (e) { logger.err(`Cannot update channel list. Reason: ${(e instanceof Error ? e.message : e)}`); }