Skip to content

Commit

Permalink
fix(health): logs error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodressel committed Aug 20, 2024
1 parent f0b4f93 commit 60bd947
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/health/logic/healthLogic.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const Sentry = require('@sentry/node');
const ipfs = require('../../backup/logic/ipfsLogic');
const cache = require('../../cache/utils/cache');
const models = require('../../../models');
const aeternity = require('../../aeternity/logic/aeternity');
const logger = require('../../../utils/logger')(module);

const HealthLogic = {
/**
Expand All @@ -17,6 +19,8 @@ const HealthLogic = {
.map(async key => models[key].findOne({ raw: true })));
return true;
} catch (e) {
logger.error(`DB health failed with: ${e.message}`);
Sentry.captureException(e);
return false;
}
},
Expand All @@ -26,6 +30,8 @@ const HealthLogic = {
await ipfs.getCoreVitals();
return true;
} catch (e) {
logger.error(`IPFS health failed with: ${e.message}`);
Sentry.captureException(e);
return false;
}
},
Expand All @@ -35,6 +41,8 @@ const HealthLogic = {
await cache.getOrSet(['redisTest'], async () => 'done');
return true;
} catch (e) {
logger.error(`Redis health failed with: ${e.message}`);
Sentry.captureException(e);
return false;
}
},
Expand All @@ -44,6 +52,8 @@ const HealthLogic = {
const balance = await aeternity.getBalance();
return parseInt(balance, 10) > 0;
} catch (e) {
logger.error(`AE health failed with: ${e.message}`);
Sentry.captureException(e);
return false;
}
},
Expand Down

0 comments on commit 60bd947

Please sign in to comment.