Skip to content

Commit a52ea18

Browse files
committed
connectors healthcheck should only fail if there are 2 consecutive failed indexing attempts for a connector
1 parent 1916b6b commit a52ea18

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

backend/danswer/server/manage/get_state.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def connectors_healthcheck(
4646
states = get_connectors_state(db_session, tenant_id)
4747
error_cnt = 0
4848
for state in states:
49+
error_cnt_for_state = 0
4950
if state.cc_pair_status == ConnectorCredentialPairStatus.ACTIVE and \
5051
state.last_finished_status == IndexingStatus.FAILED:
5152
PAGE_SIZE = 10
@@ -63,8 +64,10 @@ def connectors_healthcheck(
6364
if attempt.error_msg.startswith("Unknown index attempt"):
6465
continue
6566
else:
66-
error_cnt+=1
67-
break
67+
error_cnt_for_state += 1
68+
if error_cnt_for_state > 1:
69+
error_cnt+=1
70+
break
6871
if error_cnt > 0:
6972
success = False
7073
message = f"{error_cnt} of {len(states)} connectors failed"

0 commit comments

Comments
 (0)