Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
feat: robustify uptime crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnygleason committed Sep 12, 2019
1 parent 536e3fa commit 9ac88a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/uptime-crawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async function refreshUptime() {
console.log('uptime updater: updating...');
try {
const connection = new solanaWeb3.Connection(FULLNODE_URL);
let {voting} = await new FriendlyGet()
let {__errors__, voting} = await new FriendlyGet()
.with('voting', connection.getVoteAccounts())
.get();
let allAccounts = (voting && voting.current ? voting.current : []).concat(
Expand All @@ -89,7 +89,11 @@ async function refreshUptime() {
results = _.filter(results, x => x);
await setAsync('!uptime', JSON.stringify(results));

console.log('uptime updater: updated successfully.');
if (_.size(__errors__) === 0) {
console.log('uptime updater: updated successfully.');
} else {
console.log('ERROR updating uptime.');
}
} catch (err) {
console.log('ERROR updating uptime: ' + err);
}
Expand Down

0 comments on commit 9ac88a3

Please sign in to comment.