IndexedDB open sometime hangs forever
This commit is contained in:
parent
8c759e87cf
commit
edcce96a6e
|
@ -457,7 +457,7 @@ $(document).ready(function () {
|
|||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
$("#phrase_rep_pen_novel", function () {
|
||||
$("#phrase_rep_pen_novel").on('change', function () {
|
||||
const val = $("#phrase_rep_pen_novel").find(":selected").val();
|
||||
nai_settings.phrase_rep_pen = getPhraseRepPenString(Number(val).toFixed(0));
|
||||
saveSettingsDebounced();
|
||||
|
|
|
@ -122,15 +122,15 @@ const openrouter_website_model = 'OR_Website';
|
|||
let biasCache = undefined;
|
||||
let model_list = [];
|
||||
const objectStore = new IndexedDBStore('SillyTavern', 'chat_completions');
|
||||
const tokenCache = await loadTokenCache();
|
||||
let tokenCache = {};
|
||||
|
||||
async function loadTokenCache() {
|
||||
try {
|
||||
console.debug('Chat Completions: loading token cache from IndexedDB')
|
||||
return await objectStore.get('tokenCache') || {};
|
||||
tokenCache = await objectStore.get('tokenCache') || {};
|
||||
} catch (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 () {
|
||||
loadTokenCache();
|
||||
|
||||
$('#test_api_button').on('click', testApiConnection);
|
||||
|
||||
$(document).on('input', '#temp_openai', function () {
|
||||
|
|
Loading…
Reference in New Issue