Skip to content

Commit

Permalink
try fix for de facto model using get
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhoune committed Mar 4, 2024
1 parent f9afb51 commit 2efe175
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions src/statistics/bot-statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,19 +457,33 @@ class BotStats extends LitElement {
}

try {
const response = await fetch(url, {
method: "POST",
timeout: 10000,
headers: {
"Access-Control-Allow-Origin": "*",
Accept: "text/html",
"Content-type": "application/json",
},

body: JSON.stringify({
"bot-model": botModel,
}),
});
let response;
if (modelType === "de-facto") {
// for some weird reason the POST request fails in the cluster :/
response = await fetch(url, {
method: "GET",
timeout: 10000,
headers: {
"Access-Control-Allow-Origin": "*",
Accept: "text/html",
"Content-type": "application/json",
},
});
} else {
response = await fetch(url, {
method: "POST",
timeout: 10000,
headers: {
"Access-Control-Allow-Origin": "*",
Accept: "text/html",
"Content-type": "application/json",
},

body: JSON.stringify({
"bot-model": botModel,
}),
});
}

if (!response.ok) {
try {
Expand Down

0 comments on commit 2efe175

Please sign in to comment.