Wrap LN importer into try/catch
This commit is contained in:
parent
50d99634f7
commit
c37b4cadb1
@ -262,6 +262,7 @@ class LightningStatsImporter {
|
|||||||
* Import topology files LN historical data into the database
|
* Import topology files LN historical data into the database
|
||||||
*/
|
*/
|
||||||
async $importHistoricalLightningStats(): Promise<void> {
|
async $importHistoricalLightningStats(): Promise<void> {
|
||||||
|
try {
|
||||||
const fileList = await fsPromises.readdir(this.topologiesFolder);
|
const fileList = await fsPromises.readdir(this.topologiesFolder);
|
||||||
// Insert history from the most recent to the oldest
|
// Insert history from the most recent to the oldest
|
||||||
// This also put the .json cached files first
|
// This also put the .json cached files first
|
||||||
@ -339,6 +340,9 @@ class LightningStatsImporter {
|
|||||||
if (totalProcessed > 0) {
|
if (totalProcessed > 0) {
|
||||||
logger.info(`Lightning network stats historical import completed`);
|
logger.info(`Lightning network stats historical import completed`);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
logger.err(`Lightning network stats historical failed. Reason: ${e instanceof Error ? e.message : e}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user