Skip to content

Commit

Permalink
fix(orchestrator): clean cache before save network info (#1065)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola authored May 17, 2023
1 parent b0bef5e commit af30ecb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions javascript/packages/orchestrator/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,10 @@ export class Network {
},
);
}

cleanMetricsCache() {
for (const node of Object.values(this.nodesByName)) {
node.cleanMetricsCache();
}
}
}
4 changes: 4 additions & 0 deletions javascript/packages/orchestrator/src/networkNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,10 @@ export class NetworkNode implements NetworkNodeInterface {
return spanNames;
}

cleanMetricsCache() {
this.cachedMetrics = undefined;
}

// prevent to search in the same log line twice.
_dedupLogs(
logs: string[],
Expand Down
2 changes: 2 additions & 0 deletions javascript/packages/orchestrator/src/orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ export async function start(
`\t 🚀 LAUNCH COMPLETE under namespace ${decorators.green(namespace)} 🚀`,
);

// clean cache before dump the info.
network.cleanMetricsCache();
await fs.promises.writeFile(
`${tmpDir.path}/zombie.json`,
JSON.stringify(network),
Expand Down

0 comments on commit af30ecb

Please sign in to comment.