From 11a6d81a17eed7230cd436ef3ef1dbd0fbf8dda0 Mon Sep 17 00:00:00 2001 From: junderw Date: Thu, 7 Mar 2024 02:21:38 +0900 Subject: [PATCH 1/2] Fix: Refresh Liquid icons every 15 seconds to match electrs. --- backend/src/index.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 3a8449131..aa71f067c 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -155,11 +155,17 @@ class Server { } if (Common.isLiquid()) { - try { - icons.loadIcons(); - } catch (e) { - logger.err('Cannot load liquid icons. Ignoring. Reason: ' + (e instanceof Error ? e.message : e)); - } + const refreshIcons = () => { + try { + icons.loadIcons(); + } catch (e) { + logger.err('Cannot load liquid icons. Ignoring. Reason: ' + (e instanceof Error ? e.message : e)); + } + }; + // Run once on startup. + refreshIcons(); + // Matches electrs hard coded refresh interval for asset db. + setInterval(refreshIcons, 15000); } priceUpdater.$run(); From 1df5c5df6d533e10f84c50fb867375e09ffd5cc9 Mon Sep 17 00:00:00 2001 From: softsimon Date: Thu, 7 Mar 2024 11:09:08 +0700 Subject: [PATCH 2/2] Updating to match crontab update --- backend/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index aa71f067c..213319946 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -164,8 +164,8 @@ class Server { }; // Run once on startup. refreshIcons(); - // Matches electrs hard coded refresh interval for asset db. - setInterval(refreshIcons, 15000); + // Matches crontab refresh interval for asset db. + setInterval(refreshIcons, 3600_000); } priceUpdater.$run();