Merge pull request #284 from mq-cloudpak/add-timeout-to-chk-calls

update chkmq* cmds to use context to cancel when taking too long
This commit is contained in:
Jack Evans
2022-08-03 13:03:19 +01:00
committed by GitHub Enterprise
7 changed files with 76 additions and 41 deletions

View File

@@ -16,6 +16,7 @@ limitations under the License.
package main
import (
"context"
"fmt"
"io/ioutil"
"os"
@@ -131,7 +132,7 @@ func startQueueManager(name string) error {
func stopQueueManager(name string) error {
log.Println("Stopping queue manager")
qmGracePeriod := os.Getenv("MQ_GRACE_PERIOD")
isStandby, err := ready.IsRunningAsStandbyQM(name)
isStandby, err := ready.IsRunningAsStandbyQM(context.Background(), name)
if err != nil {
log.Printf("Error getting status for queue manager %v: %v", name, err.Error())
return err