Fix sendless statuses

a86735d7436939df3473a3cf51b8f9314edd6345

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +11 -11Showing whitespace changes
src/endpoints/backends/text-completions.js+11 -11
@@ -152,7 +152,7 @@ router.post('/status', jsonParser, async function (request, response) {
152152
153153 if (!modelsReply.ok) {
154154 console.log('Models endpoint is offline.');
155155 return response.statussendStatus(400);
156156 }
157157
158158 /** @type {any} */
@@ -173,7 +173,7 @@ router.post('/status', jsonParser, async function (request, response) {
173173
174174 if (!Array.isArray(data.data)) {
175175 console.log('Models response is not an array.');
176176 return response.statussendStatus(400);
177177 }
178178
179179 const modelIds = data.data.map(x => x.id);
@@ -224,7 +224,7 @@ router.post('/status', jsonParser, async function (request, response) {
224224 return response.send({ result, data: data.data });
225225 } catch (error) {
226226 console.error(error);
227227 return response.statussendStatus(500);
228228 }
229229});
230230
@@ -244,7 +244,7 @@ router.post('/props', jsonParser, async function (request, response) {
244244 const propsReply = await fetch(propsUrl, args);
245245
246246 if (!propsReply.ok) {
247247 return response.statussendStatus(400);
248248 }
249249
250250 /** @type {any} */
@@ -258,7 +258,7 @@ router.post('/props', jsonParser, async function (request, response) {
258258 return response.send(props);
259259 } catch (error) {
260260 console.error(error);
261261 return response.statussendStatus(500);
262262 }
263263});
264264
@@ -450,7 +450,7 @@ ollama.post('/download', jsonParser, async function (request, response) {
450450 return response.send({ ok: true });
451451 } catch (error) {
452452 console.error(error);
453453 return response.statussendStatus(500);
454454 }
455455});
456456
@@ -493,7 +493,7 @@ ollama.post('/caption-image', jsonParser, async function (request, response) {
493493 return response.send({ caption });
494494 } catch (error) {
495495 console.error(error);
496496 return response.statussendStatus(500);
497497 }
498498});
499499
@@ -540,7 +540,7 @@ llamacpp.post('/caption-image', jsonParser, async function (request, response) {
540540
541541 } catch (error) {
542542 console.error(error);
543543 return response.statussendStatus(500);
544544 }
545545});
546546
@@ -569,7 +569,7 @@ llamacpp.post('/props', jsonParser, async function (request, response) {
569569
570570 } catch (error) {
571571 console.error(error);
572572 return response.statussendStatus(500);
573573 }
574574});
575575
@@ -619,7 +619,7 @@ llamacpp.post('/slots', jsonParser, async function (request, response) {
619619
620620 } catch (error) {
621621 console.error(error);
622622 return response.statussendStatus(500);
623623 }
624624});
625625
@@ -665,7 +665,7 @@ tabby.post('/download', jsonParser, async function (request, response) {
665665 return response.send({ ok: true });
666666 } catch (error) {
667667 console.error(error);
668668 return response.statussendStatus(500);
669669 }
670670});
671671