Pull partner token ledgers into a RAM cache so fleet totals are fleet-wide
This commit is contained in:
@@ -473,9 +473,15 @@ if (is_dir('/var/log/varaverk')) {
|
||||
+ `<span class="vv-ai-hostrow-v">${num(tokData.all.total)}</span></div>`;
|
||||
Object.keys(hosts).forEach(id => {
|
||||
const x = hosts[id];
|
||||
// Three states, not two. "synced" is a partner whose ledger ai_token_sync.sh pulled;
|
||||
// "not collected here" is a partner we have never seen a ledger for. Collapsing the
|
||||
// second into a zero would report the partner as idle when the truth is we cannot see it.
|
||||
const tag = x.self ? ' · this host'
|
||||
: x.synced ? ' · synced ' + ago(x.synced)
|
||||
: '';
|
||||
hh += `<div class="vv-ai-hostrow${tokScope === id ? ' active' : ''}" data-scope="${esc(id)}">`
|
||||
+ `<span class="vv-ai-hostrow-n">${esc(x.name)}</span>`
|
||||
+ `<span class="vv-ai-hostrow-h">${esc(id)}${x.self ? ' · this host' : ''}</span>`
|
||||
+ `<span class="vv-ai-hostrow-h">${esc(id)}${tag}</span>`
|
||||
+ (x.seen ? `<span class="vv-ai-hostrow-v">${num(x.all.total)}</span>`
|
||||
: `<span class="vv-ai-hostrow-v none">not collected here</span>`)
|
||||
+ `</div>`;
|
||||
|
||||
Reference in New Issue
Block a user