parent
e6bc5bef33
commit
e3109a8fec
@ -215,11 +215,11 @@ class Server {
|
|||||||
await lightningStatsUpdater.$startService();
|
await lightningStatsUpdater.$startService();
|
||||||
await forensicsService.$startService();
|
await forensicsService.$startService();
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
logger.err(`Nodejs lightning backend crashed. Restarting in 1 minute. Reason: ${(e instanceof Error ? e.message : e)}`);
|
logger.err(`Exception in $runLightningBackend. Restarting in 1 minute. Reason: ${(e instanceof Error ? e.message : e)}`);
|
||||||
await Common.sleep$(1000 * 60);
|
await Common.sleep$(1000 * 60);
|
||||||
this.$runLightningBackend();
|
this.$runLightningBackend();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
setUpWebsocketHandling(): void {
|
setUpWebsocketHandling(): void {
|
||||||
if (this.wss) {
|
if (this.wss) {
|
||||||
|
@ -22,12 +22,15 @@ class LightningStatsUpdater {
|
|||||||
* Update the latest entry for each node every config.LIGHTNING.STATS_REFRESH_INTERVAL seconds
|
* Update the latest entry for each node every config.LIGHTNING.STATS_REFRESH_INTERVAL seconds
|
||||||
*/
|
*/
|
||||||
private async $logStatsDaily(): Promise<void> {
|
private async $logStatsDaily(): Promise<void> {
|
||||||
|
try {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
Common.setDateMidnight(date);
|
Common.setDateMidnight(date);
|
||||||
const networkGraph = await lightningApi.$getNetworkGraph();
|
const networkGraph = await lightningApi.$getNetworkGraph();
|
||||||
await LightningStatsImporter.computeNetworkStats(date.getTime() / 1000, networkGraph);
|
await LightningStatsImporter.computeNetworkStats(date.getTime() / 1000, networkGraph);
|
||||||
|
|
||||||
logger.debug(`Updated latest network stats`, logger.tags.ln);
|
logger.debug(`Updated latest network stats`, logger.tags.ln);
|
||||||
|
} catch (e) {
|
||||||
|
logger.err(`Exception in $logStatsDaily. Reason: ${(e instanceof Error ? e.message : e)}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user