mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Decrease connection timeout, set 'valid' status on 'invalid URL', don't wait if not needed
Fixes #3683
This commit is contained in:
@ -9288,10 +9288,12 @@ async function connectAPISlash(args, text) {
|
||||
const toast = quiet ? jQuery() : toastr.info(t`API set to ${text}, trying to connect..`);
|
||||
|
||||
try {
|
||||
await waitUntilCondition(() => online_status !== 'no_connection', 10000, 100);
|
||||
if (connectionRequired) {
|
||||
await waitUntilCondition(() => online_status !== 'no_connection', 5000, 500);
|
||||
}
|
||||
console.log('Connection successful');
|
||||
} catch {
|
||||
console.log('Could not connect after 10 seconds, skipping.');
|
||||
console.log('Could not connect after 5 seconds, skipping.');
|
||||
}
|
||||
|
||||
toastr.clear(toast);
|
||||
|
Reference in New Issue
Block a user