fix: force dashboard refresh after Codex account scan completes
This commit is contained in:
@@ -804,7 +804,8 @@ async function refreshAllCodexAccountUsage(): Promise<void> {
|
|||||||
let maxH5 = 0;
|
let maxH5 = 0;
|
||||||
let maxD7 = 0;
|
let maxD7 = 0;
|
||||||
let h5Reset: string | number | undefined = usage[0].primary.resetsAt;
|
let h5Reset: string | number | undefined = usage[0].primary.resetsAt;
|
||||||
let d7Reset: string | number | undefined = usage[0].secondary.resetsAt;
|
let d7Reset: string | number | undefined =
|
||||||
|
usage[0].secondary.resetsAt;
|
||||||
for (const limit of usage) {
|
for (const limit of usage) {
|
||||||
if (limit.primary.usedPercent >= maxH5) {
|
if (limit.primary.usedPercent >= maxH5) {
|
||||||
maxH5 = limit.primary.usedPercent;
|
maxH5 = limit.primary.usedPercent;
|
||||||
@@ -905,9 +906,13 @@ export async function startUnifiedDashboard(
|
|||||||
if (isRenderer) {
|
if (isRenderer) {
|
||||||
setInterval(refreshUsageCache, opts.usageUpdateInterval);
|
setInterval(refreshUsageCache, opts.usageUpdateInterval);
|
||||||
// Full scan of all Codex accounts on startup + hourly
|
// Full scan of all Codex accounts on startup + hourly
|
||||||
void refreshAllCodexAccountUsage();
|
// After scan, refresh dashboard so cached data is visible immediately
|
||||||
|
void refreshAllCodexAccountUsage().then(() => {
|
||||||
|
void refreshUsageCache().then(() => void updateStatus());
|
||||||
|
});
|
||||||
setInterval(
|
setInterval(
|
||||||
() => void refreshAllCodexAccountUsage(),
|
() =>
|
||||||
|
void refreshAllCodexAccountUsage().then(() => void refreshUsageCache()),
|
||||||
CODEX_FULL_SCAN_INTERVAL,
|
CODEX_FULL_SCAN_INTERVAL,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user