auto-git:
[change] main.js
This commit is contained in:
8
main.js
8
main.js
@@ -150,16 +150,16 @@ async function ensureOllamaRunning() { //temporary hack
|
|||||||
console.error('[AutoGit] ollama serve konnte nicht gestartet werden:', e.message);
|
console.error('[AutoGit] ollama serve konnte nicht gestartet werden:', e.message);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
// Warte bis zu 10x 500ms (max. 5 Sekunden), ob Port aufgeht
|
// Warte bis zu 2x 5000mx (max. 10 Sekunden), ob Port aufgeht
|
||||||
for (let i = 0; i < 20; i++) {
|
for (let i = 0; i < 2; i++) {
|
||||||
await new Promise(res => setTimeout(res, 500));
|
await new Promise(res => setTimeout(res, 5000));
|
||||||
try {
|
try {
|
||||||
await pingOllama();
|
await pingOllama();
|
||||||
console.log('[AutoGit] Ollama läuft jetzt!');
|
console.log('[AutoGit] Ollama läuft jetzt!');
|
||||||
return true;
|
return true;
|
||||||
} catch (_) {/*noch nicht da*/}
|
} catch (_) {/*noch nicht da*/}
|
||||||
}
|
}
|
||||||
throw new Error('[AutoGit] ollama serve konnte nach 5 Sekunden nicht erreicht werden!');
|
throw new Error('[AutoGit] ollama serve konnte nach 10 Sekunden nicht erreicht werden!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user