mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 02:25:59 +00:00
renamed file
This commit is contained in:
@@ -2,6 +2,8 @@ import _ from 'lodash';
|
|||||||
import { currentDatabase, openedConnectionsWithTemporary, getCurrentConfig, getOpenedConnections } from '../stores';
|
import { currentDatabase, openedConnectionsWithTemporary, getCurrentConfig, getOpenedConnections } from '../stores';
|
||||||
import { apiCall, getVolatileConnections, strmid } from './api';
|
import { apiCall, getVolatileConnections, strmid } from './api';
|
||||||
import hasPermission from '../utility/hasPermission';
|
import hasPermission from '../utility/hasPermission';
|
||||||
|
import { getConfig } from './metadataLoaders';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
// const doServerPing = async value => {
|
// const doServerPing = async value => {
|
||||||
// const connectionList = getConnectionList();
|
// const connectionList = getConnectionList();
|
||||||
@@ -57,3 +59,19 @@ export function callServerPing() {
|
|||||||
const connections = getOpenedConnections();
|
const connections = getOpenedConnections();
|
||||||
doServerPing(connections);
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user