1
0
mirror of https://github.com/osmarks/autobotrobot synced 2024-10-29 21:16:17 +00:00

fix failovers

This commit is contained in:
osmarks 2024-10-17 21:18:32 +01:00
parent a311f30602
commit dd3776ea1e

View File

@ -386,6 +386,8 @@ async def generate(sess: aiohttp.ClientSession, prompt, stop=["\n"]):
try:
result = await generate_raw(sess, backend, prompt, stop)
backend_successes.labels(backend["url"]).inc()
failure_stats = last_failures[backend["url"]]
failure_stats.consecutive_failures = 0
return result
except Exception as e:
backend_failures.labels(backend["url"]).inc()