From 53a8791c27593edbf8f994097c8f662d75fcf036 Mon Sep 17 00:00:00 2001 From: Abu Sayed <82162518+sayedppqq@users.noreply.github.com> Date: Fri, 9 Feb 2024 15:12:29 +0600 Subject: [PATCH] currentOp command update (#1994) Signed-off-by: sayedppqq --- pkg/lock.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/lock.go b/pkg/lock.go index 1fd890c70..ad376ab5b 100644 --- a/pkg/lock.go +++ b/pkg/lock.go @@ -129,10 +129,10 @@ func checkIfSecondaryLockedAndSync(mongohost string) error { x := make(map[string]interface{}) args := append([]interface{}{ - "config", + "admin", "--host", mongohost, "--quiet", - "--eval", "JSON.stringify(db.currentOp())", + "--eval", "rs.secondaryOk(); JSON.stringify(db.runCommand({currentOp:1}))", }, mongoCreds...) output, err := sh.Command(MongoCMD, args...).Output() if err != nil {