Skip to content

Commit ab25cdb

Browse files
committed
Invert condition
1 parent 25c01fb commit ab25cdb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mem3_helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def check_membership_forever():
8585
resp = requests.get(uri, auth=creds)
8686
else:
8787
resp = requests.get(uri)
88-
if resp.status_code == 200:
88+
if resp.status_code != 200:
89+
print('ERROR: _membership responded with', resp.status_code, '!', file=sys.stderr)
90+
else:
8991
try:
9092
membership_json = json.loads(resp.text)
9193
if 'error' in membership_json:
@@ -99,8 +101,6 @@ def check_membership_forever():
99101
print('ERROR: _membership response does not contain expected data structure!', file=sys.stderr)
100102
except json.decoder.JSONDecodeError:
101103
print('ERROR: unable to decode JSON in _membership response!', file=sys.stderr)
102-
else:
103-
print('ERROR: _membership responded with', resp.status_code, '!', file=sys.stderr)
104104
time.sleep(10)
105105

106106
if __name__ == '__main__':

0 commit comments

Comments
 (0)