From 5fefbb46a79b1226c48fdc3013952929ce92236c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 4 May 2024 18:00:10 +0800 Subject: [PATCH] Update index.py --- plugins/mongodb/index.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index de558e756..21cf01a40 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -1070,13 +1070,18 @@ def replClose(): ] } - # client = mongdbClient() - # try: - # # {force:True} - # rsStatus = client.admin.command('replSetReconfig',config) - # except Exception as e: - # info = str(e).split(',') - # return mw.returnJson(False, str(info[0])) + client = mongdbClient() + try: + # {force:True} + # repl_info = client.admin.command('replSetGetStatus') + # repl_info['members'] = [] + # del repl_info['set'] + + # print(repl_info) + rsStatus = client.admin.command('replSetReconfig',config) + except Exception as e: + info = str(e).split(',') + return mw.returnJson(False, str(info[0])) d = getConfigData() if 'replSetName' in d['replication']: