fix: batch status reporting after complete (#17852)

batch status can perpetually wait after completion
due to a race between the MetricsHandler() returning
the active metrics in intervals of 1sec and delete
of metrics after job completion.

this PR ensures that we keep the 'status' around
for a while, i.e upto 24hrs for all the batch jobs.
This commit is contained in:
Harshavardhana
2023-08-15 12:22:30 -07:00
committed by GitHub
parent c4ca0a5a57
commit 3ba927edae
3 changed files with 53 additions and 14 deletions

View File

@@ -95,6 +95,9 @@ func init() {
initGlobalContext()
globalBatchJobsMetrics = batchJobMetrics{metrics: make(map[string]*batchJobInfo)}
go globalBatchJobsMetrics.purgeJobMetrics()
t, _ := minioVersionToReleaseTime(Version)
if !t.IsZero() {
globalVersionUnix = uint64(t.Unix())