Horde fire and forget delete request

This commit is contained in:
Cohee 2023-11-19 21:30:08 +02:00
parent 9dcc23825a
commit a39ee32f93
2 changed files with 4 additions and 8 deletions

View File

@ -3777,11 +3777,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
} }
reject(exception); reject(exception);
$("#send_textarea").removeAttr('disabled'); unblockGeneration();
is_send_press = false;
activateSendButtons();
showSwipeButtons();
setGenerationProgress(0);
console.log(exception); console.log(exception);
streamingProcessor = null; streamingProcessor = null;
}; };

View File

@ -31,8 +31,8 @@ let horde_settings = {
trusted_workers_only: false, trusted_workers_only: false,
}; };
const MAX_RETRIES = 240; const MAX_RETRIES = 480;
const CHECK_INTERVAL = 5000; const CHECK_INTERVAL = 2500;
const MIN_LENGTH = 16; const MIN_LENGTH = 16;
const getRequestArgs = () => ({ const getRequestArgs = () => ({
method: "GET", method: "GET",
@ -152,7 +152,7 @@ async function generateHorde(prompt, params, signal, reportProgress) {
for (let retryNumber = 0; retryNumber < MAX_RETRIES; retryNumber++) { for (let retryNumber = 0; retryNumber < MAX_RETRIES; retryNumber++) {
if (signal.aborted) { if (signal.aborted) {
await fetch(`https://horde.koboldai.net/api/v2/generate/text/status/${task_id}`, { fetch(`https://horde.koboldai.net/api/v2/generate/text/status/${task_id}`, {
method: 'DELETE', method: 'DELETE',
headers: { headers: {
"Client-Agent": CLIENT_VERSION, "Client-Agent": CLIENT_VERSION,