Merge pull request #4743 from mempool/junderw/reload-icons

Fix: Refresh Liquid icons every 15 seconds to match electrs.
This commit is contained in:
softsimon 2024-03-07 11:09:33 +07:00 committed by GitHub
commit b988f042cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 crontab refresh interval for asset db.
setInterval(refreshIcons, 3600_000);
}
priceUpdater.$run();