mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 10:16:00 +00:00
SYNC: fixed allocating port for native backup & restore #1092
This commit is contained in:
committed by
Diflow
parent
725399ac7c
commit
4b3c0466eb
@@ -622,20 +622,23 @@ module.exports = {
|
||||
{ conid, database, outputFile, inputFile, options, selectedTables, skippedTables, argsFormat }
|
||||
) {
|
||||
const sourceConnection = await connections.getCore({ conid });
|
||||
let connection = decryptConnection(sourceConnection);
|
||||
const connection = {
|
||||
...decryptConnection(sourceConnection),
|
||||
};
|
||||
const driver = requireEngineDriver(connection);
|
||||
|
||||
if (!connection.port && driver.defaultPort) {
|
||||
connection.port = driver.defaultPort.toString();
|
||||
}
|
||||
|
||||
if (connection.useSshTunnel) {
|
||||
const tunnel = await getSshTunnel(connection);
|
||||
if (tunnel.state == 'error') {
|
||||
throw new Error(tunnel.message);
|
||||
}
|
||||
|
||||
connection = {
|
||||
...connection,
|
||||
server: tunnel.localHost,
|
||||
port: tunnel.localPort,
|
||||
}
|
||||
connection.server = tunnel.localHost;
|
||||
connection.port = tunnel.localPort;
|
||||
}
|
||||
|
||||
const settingsValue = await config.getSettings();
|
||||
|
||||
Reference in New Issue
Block a user