auto-git:
[change] main.js
This commit is contained in:
18
main.js
18
main.js
@@ -128,7 +128,7 @@ async function ensureOllamaRunning() { //temporary hack
|
|||||||
// Port-Test als Promise
|
// Port-Test als Promise
|
||||||
function pingOllama() {
|
function pingOllama() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const req = http.request({ hostname: 'localhost', port: 11434, path: '/', method: 'GET', timeout: 500 }, res => {
|
const req = http.request({ hostname: 'localhost', port: 11434, path: '/', method: 'GET', timeout: 5000 }, res => {
|
||||||
res.destroy(); resolve(true);
|
res.destroy(); resolve(true);
|
||||||
});
|
});
|
||||||
req.on('error', reject);
|
req.on('error', reject);
|
||||||
@@ -136,22 +136,6 @@ async function ensureOllamaRunning() { //temporary hack
|
|||||||
req.end();
|
req.end();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Probieren, ob Ollama erreichbar ist
|
// Probieren, ob Ollama erreichbar ist
|
||||||
try {
|
try {
|
||||||
await pingOllama();
|
await pingOllama();
|
||||||
|
|||||||
Reference in New Issue
Block a user