redis load keys optimalization

This commit is contained in:
SPRINX0\prochazka
2025-01-22 08:49:58 +01:00
parent 0c35aefbe2
commit 4793bad92f
4 changed files with 13 additions and 10 deletions

View File

@@ -229,9 +229,9 @@ module.exports = {
},
loadKeys_meta: true,
async loadKeys({ conid, database, root, filter }, req) {
async loadKeys({ conid, database, root, filter, limit }, req) {
testConnectionPermission(conid, req);
return this.loadDataCore('loadKeys', { conid, database, root, filter });
return this.loadDataCore('loadKeys', { conid, database, root, filter, limit });
},
exportKeys_meta: true,

View File

@@ -258,8 +258,8 @@ async function handleCollectionData({ msgid, options }) {
return handleDriverDataCore(msgid, driver => driver.readCollection(dbhan, options), { logName: 'readCollection' });
}
async function handleLoadKeys({ msgid, root, filter }) {
return handleDriverDataCore(msgid, driver => driver.loadKeys(dbhan, root, filter), { logName: 'loadKeys' });
async function handleLoadKeys({ msgid, root, filter, limit }) {
return handleDriverDataCore(msgid, driver => driver.loadKeys(dbhan, root, filter, limit), { logName: 'loadKeys' });
}
async function handleExportKeys({ msgid, options }) {

View File

@@ -5,7 +5,8 @@
import LoadingInfo from '../elements/LoadingInfo.svelte';
import { apiCall } from '../utility/api';
const SHOW_INCREMENT = 500;
// const SHOW_INCREMENT = 500;
const SHOW_INCREMENT = 10;
import DbKeysTreeNode from './DbKeysTreeNode.svelte';
@@ -26,7 +27,7 @@
// $: items = useDatabaseKeys({ conid, database, root, reloadToken });
</script>
{#await apiCall('database-connections/load-keys', { conid, database, root, filter, reloadToken, reloadToken2 })}
{#await apiCall( 'database-connections/load-keys', { conid, database, root, filter, reloadToken, reloadToken2, limit: maxShowCount + 1 } )}
<LoadingInfo message="Loading key list" wrapper />
{:then items}
{@const itemsSorted = _.sortBy(items || [], 'text')}