Make sure lightning stats are not duplicated in db
This commit is contained in:
@@ -8,8 +8,8 @@ class LightningStatsUpdater {
|
||||
public async $startService(): Promise<void> {
|
||||
logger.info('Starting Lightning Stats service');
|
||||
|
||||
// LightningStatsImporter.$run();
|
||||
this.$runTasks();
|
||||
await this.$runTasks();
|
||||
LightningStatsImporter.$run();
|
||||
}
|
||||
|
||||
private setDateMidnight(date: Date): void {
|
||||
@@ -35,7 +35,7 @@ class LightningStatsUpdater {
|
||||
this.setDateMidnight(date);
|
||||
date.setUTCHours(24);
|
||||
|
||||
logger.info(`Updating latest node stats`);
|
||||
logger.info(`Updating latest networks stats`);
|
||||
const networkGraph = await lightningApi.$getNetworkGraph();
|
||||
LightningStatsImporter.computeNetworkStats(date.getTime() / 1000, networkGraph);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user