mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
Feat : Auto restart after crash
This commit is contained in:
@@ -38,8 +38,15 @@ export async function handleComboChat({ body, models, handleSingleModel, log })
|
||||
const modelStr = models[i];
|
||||
log.info("COMBO", `Trying model ${i + 1}/${models.length}: ${modelStr}`);
|
||||
|
||||
const result = await handleSingleModel(body, modelStr);
|
||||
|
||||
let result;
|
||||
try {
|
||||
result = await handleSingleModel(body, modelStr);
|
||||
} catch (e) {
|
||||
lastError = `${modelStr}: ${e.message}`;
|
||||
log.warn("COMBO", `Model threw exception, trying next`, { model: modelStr, error: e.message });
|
||||
continue;
|
||||
}
|
||||
|
||||
// Success or client error - return response
|
||||
if (result.ok || result.status < 500) {
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user