Skip to content

Commit

Permalink
fix(api): catch heartbeat error
Browse files Browse the repository at this point in the history
  • Loading branch information
jakowenko committed May 25, 2022
1 parent c2f799e commit f085dad
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions api/src/util/heartbeat.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ module.exports.cron = async () => {
};

module.exports.track = async (type) => {
await axios({
method: 'post',
url: 'https://analytics.jako.io/api/event',
data: {
name: 'pageview',
url: `http://localhost/${type}`,
domain: 'double-take-api',
props: JSON.stringify({
version,
arch: os.arch(),
}),
},
validateStatus: () => true,
});
try {
await axios({
method: 'post',
url: 'https://analytics.jako.io/api/event',
data: {
name: 'pageview',
url: `http://localhost/${type}`,
domain: 'double-take-api',
props: JSON.stringify({
version,
arch: os.arch(),
}),
},
validateStatus: () => true,
});
// eslint-disable-next-line no-empty
} catch (error) {}
};

0 comments on commit f085dad

Please sign in to comment.