Dedup subcommand calls for readiness check

This commit is contained in:
Alex Mirski-Fitton
2022-11-15 15:09:16 +00:00
parent 537320a32d
commit 8efaa55c4f
4 changed files with 47 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
/*
© Copyright IBM Corporation 2018, 2022
© Copyright IBM Corporation 2018, 2023
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -43,8 +43,8 @@ func GatherMetrics(qmName string, log *logger.Logger) {
// If running in standby mode - wait until the queue manager becomes active
for {
active, _ := ready.IsRunningAsActiveQM(context.Background(), qmName)
if active {
status, _ := ready.Status(context.Background(), qmName)
if status.ActiveQM() {
break
}
time.Sleep(requestTimeout * time.Second)