mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Adjust debounce rate. Prevent autoconnect before secrets load
This commit is contained in:
@ -261,7 +261,7 @@ let fav_ch_checked = false;
|
|||||||
//initialize global var for future cropped blobs
|
//initialize global var for future cropped blobs
|
||||||
let currentCroppedAvatar = '';
|
let currentCroppedAvatar = '';
|
||||||
|
|
||||||
const durationSaveEdit = 200;
|
const durationSaveEdit = 500;
|
||||||
const saveSettingsDebounced = debounce(() => saveSettings(), durationSaveEdit);
|
const saveSettingsDebounced = debounce(() => saveSettings(), durationSaveEdit);
|
||||||
const saveCharacterDebounced = debounce(() => $("#create_button").trigger('click'), durationSaveEdit);
|
const saveCharacterDebounced = debounce(() => $("#create_button").trigger('click'), durationSaveEdit);
|
||||||
const getStatusDebounced = debounce(() => getStatus(), 90000);
|
const getStatusDebounced = debounce(() => getStatus(), 90000);
|
||||||
|
@ -370,7 +370,8 @@ function RA_checkOnlineStatus() {
|
|||||||
//Auto-connect to API (when set to kobold, API URL exists, and auto_connect is true)
|
//Auto-connect to API (when set to kobold, API URL exists, and auto_connect is true)
|
||||||
|
|
||||||
function RA_autoconnect(PrevApi) {
|
function RA_autoconnect(PrevApi) {
|
||||||
if (online_status === undefined) {
|
// secrets.js or script.js not loaded
|
||||||
|
if (SECRET_KEYS === undefined || online_status === undefined) {
|
||||||
setTimeout(RA_autoconnect, 100);
|
setTimeout(RA_autoconnect, 100);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -404,7 +405,6 @@ function RA_autoconnect(PrevApi) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!connection_made) {
|
if (!connection_made) {
|
||||||
|
|
||||||
RA_AC_retries++;
|
RA_AC_retries++;
|
||||||
retry_delay = Math.min(retry_delay * 2, 30000); // double retry delay up to to 30 secs
|
retry_delay = Math.min(retry_delay * 2, 30000); // double retry delay up to to 30 secs
|
||||||
//console.log('connection attempts: ' + RA_AC_retries + ' delay: ' + (retry_delay / 1000) + 's');
|
//console.log('connection attempts: ' + RA_AC_retries + ' delay: ' + (retry_delay / 1000) + 's');
|
||||||
|
Reference in New Issue
Block a user