hold on to batch job stats till cleanup (#20480)

This PR also fixes job stats not available after restart
This commit is contained in:
Poorna
2024-09-24 14:50:11 -07:00
committed by GitHub
parent 2b0156b1fc
commit b2c5819dbc
3 changed files with 36 additions and 4 deletions

View File

@@ -1104,6 +1104,11 @@ func serverMain(ctx *cli.Context) {
// Initialize batch job pool.
bootstrapTrace("newBatchJobPool", func() {
globalBatchJobPool = newBatchJobPool(GlobalContext, newObject, 100)
globalBatchJobsMetrics = batchJobMetrics{
metrics: make(map[string]*batchJobInfo),
}
go globalBatchJobsMetrics.init(GlobalContext, newObject)
go globalBatchJobsMetrics.purgeJobMetrics()
})
// Prints the formatted startup message, if err is not nil then it prints additional information as well.