comms: retry atlasbot login
This commit is contained in:
parent
ac7217a32c
commit
97e7c69244
@ -604,9 +604,19 @@ data:
|
||||
reply = ollama_reply(hist_key, body, context=context)
|
||||
send_msg(token, rid, reply)
|
||||
|
||||
def login_with_retry():
|
||||
last_err = None
|
||||
for attempt in range(10):
|
||||
try:
|
||||
return login()
|
||||
except Exception as exc: # noqa: BLE001
|
||||
last_err = exc
|
||||
time.sleep(min(30, 2 ** attempt))
|
||||
raise last_err
|
||||
|
||||
def main():
|
||||
load_kb()
|
||||
token = login()
|
||||
token = login_with_retry()
|
||||
try:
|
||||
room_id = resolve_alias(token, ROOM_ALIAS)
|
||||
join_room(token, room_id)
|
||||
|
||||
@ -16,7 +16,7 @@ spec:
|
||||
labels:
|
||||
app: atlasbot
|
||||
annotations:
|
||||
checksum/atlasbot-configmap: 80fa4d62ccafbfbcdeb63f0976cbea36aada12649f15f8570932296db5d48949
|
||||
checksum/atlasbot-configmap: manual-atlasbot-2
|
||||
spec:
|
||||
serviceAccountName: atlasbot
|
||||
nodeSelector:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user