renamed file

This commit is contained in:
SPRINX0\prochazka
2025-02-14 14:04:25 +01:00
parent a86693d950
commit 43163c787d

View File

@@ -2,6 +2,8 @@ import _ from 'lodash';
import { currentDatabase, openedConnectionsWithTemporary, getCurrentConfig, getOpenedConnections } from '../stores';
import { apiCall, getVolatileConnections, strmid } from './api';
import hasPermission from '../utility/hasPermission';
import { getConfig } from './metadataLoaders';
import { onMount } from 'svelte';
// const doServerPing = async value => {
// const connectionList = getConnectionList();
@@ -57,3 +59,19 @@ export function callServerPing() {
const connections = getOpenedConnections();
doServerPing(connections);
}
export async function mountStorageConnectionPing() {
const config = getCurrentConfig();
onMount(() => {
const conid = '__storage';
const database = config.storageDatabase;
apiCall('database-connections/ping', { conid, database });
const handle = setInterval(() => {
if (conid && database) {
apiCall('database-connections/ping', { conid, database });
}
}, 20 * 1000);
return () => clearInterval(handle);
});
}