Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new %NODEHOST% substitution, fixes #2731 #2843

Merged
merged 5 commits into from
Jun 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle error better
  • Loading branch information
awick committed Jun 17, 2024
commit d4ef945fdf62bfe90248571bfa72bfd94795cedf
10 changes: 8 additions & 2 deletions viewer/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,8 @@ Db.arkimeNodeStats = async (nodeName, cb) => {

cb(null, stat._source);
} catch (err) {
if (internals.arkimeNodeStatsCache.has(nodeName)) {
const value = internals.arkimeNodeStatsCache.get(nodeName);
if (value && value._timeStamp) {
return cb(null, internals.arkimeNodeStatsCache.get(nodeName));
}
return cb(err || 'Unknown node ' + nodeName);
Expand All @@ -1439,10 +1440,15 @@ Db.arkimeNodeStatsCache = function (nodeName, cb) {
}

return Db.arkimeNodeStats(nodeName, (err, newStat) => {
if (err) {
internals.arkimeNodeStatsCache.delete(nodeName);
} else {
internals.arkimeNodeStatsCache.set(nodeName, newStat);
}

stat._waiting.forEach((scb) => {
scb(err, newStat);
});
internals.arkimeNodeStatsCache.set(nodeName, newStat);
});
};

Expand Down