Use node-fetch to make requests without timeout #435

This commit is contained in:
Cohee
2023-06-04 04:29:22 +03:00
parent 0dbf219116
commit c299ef0a86
3 changed files with 5 additions and 4 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "sillytavern",
"version": "1.6.5",
"version": "1.6.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sillytavern",
"version": "1.6.5",
"version": "1.6.6",
"license": "AGPL-3.0",
"dependencies": {
"@dqbd/tiktoken": "^1.0.2",

View File

@@ -46,7 +46,7 @@
"type": "git",
"url": "https://github.com/Cohee1207/SillyTavern.git"
},
"version": "1.6.5",
"version": "1.6.6",
"scripts": {
"start": "node server.js",
"pkg": "pkg --compress Gzip --no-bytecode --public ."

View File

@@ -2684,7 +2684,8 @@ function putAsync(url, args) {
}
async function postAsync(url, args) {
const response = await fetch(url, { method: 'POST', ...args });
const fetch = require('node-fetch').default;
const response = await fetch(url, { method: 'POST', timeout: 0, ...args });
if (response.ok) {
const data = await response.json();