mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
IndexedDB open sometime hangs forever
This commit is contained in:
@ -457,7 +457,7 @@ $(document).ready(function () {
|
|||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#phrase_rep_pen_novel", function () {
|
$("#phrase_rep_pen_novel").on('change', function () {
|
||||||
const val = $("#phrase_rep_pen_novel").find(":selected").val();
|
const val = $("#phrase_rep_pen_novel").find(":selected").val();
|
||||||
nai_settings.phrase_rep_pen = getPhraseRepPenString(Number(val).toFixed(0));
|
nai_settings.phrase_rep_pen = getPhraseRepPenString(Number(val).toFixed(0));
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
|
@ -122,15 +122,15 @@ const openrouter_website_model = 'OR_Website';
|
|||||||
let biasCache = undefined;
|
let biasCache = undefined;
|
||||||
let model_list = [];
|
let model_list = [];
|
||||||
const objectStore = new IndexedDBStore('SillyTavern', 'chat_completions');
|
const objectStore = new IndexedDBStore('SillyTavern', 'chat_completions');
|
||||||
const tokenCache = await loadTokenCache();
|
let tokenCache = {};
|
||||||
|
|
||||||
async function loadTokenCache() {
|
async function loadTokenCache() {
|
||||||
try {
|
try {
|
||||||
console.debug('Chat Completions: loading token cache from IndexedDB')
|
console.debug('Chat Completions: loading token cache from IndexedDB')
|
||||||
return await objectStore.get('tokenCache') || {};
|
tokenCache = await objectStore.get('tokenCache') || {};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('Chat Completions: unable to load token cache from IndexedDB, using default value', e);
|
console.log('Chat Completions: unable to load token cache from IndexedDB, using default value', e);
|
||||||
return {};
|
tokenCache = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2800,6 +2800,8 @@ function onProxyPasswordShowClick() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
loadTokenCache();
|
||||||
|
|
||||||
$('#test_api_button').on('click', testApiConnection);
|
$('#test_api_button').on('click', testApiConnection);
|
||||||
|
|
||||||
$(document).on('input', '#temp_openai', function () {
|
$(document).on('input', '#temp_openai', function () {
|
||||||
|
Reference in New Issue
Block a user