feat: fetch modelInfo
gitea/mylogger/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2025-04-08 14:44:34 +02:00
parent 011ed225a2
commit fd57221ea8
1 changed files with 6 additions and 6 deletions

View File

@ -142,11 +142,12 @@ module.exports = class Salix {
`${this.conf.salix.url}/${path}`,
fetchConfig
);
if (salixCall.status !== 200) {
throw new Error(response);
}
const responseText = await salixCall.text();
const response = JSON.parse(responseText);
if (salixCall.status !== 200) {
throw new Error(response.error.message);
}
const newVersion = salixCall.headers.get(SALIX_VERSION_HEADER);
if (!this.salixVersion) {
@ -172,14 +173,13 @@ module.exports = class Salix {
async getSalixVersion() {
this.log("CHECK VERSION");
await this.fetch(this.conf.salix.api.status);
await this.fetch(this.conf.salix.api.modelinfo);
this.log("VERSION CHECKED");
this.log("VERSION CHECKED -- "+ this.salixVersion);
}
async salixLogInfo() {
this.log("REQUEST LOGINFO");
await this.getToken();
let salixLogConfig = await this.fetch(this.conf.salix.api.logInfo);
this._logInfo = salixLogConfig;