SYNC: fixed allocating port for native backup & restore #1092

This commit is contained in:
SPRINX0\prochazka
2025-04-09 09:27:55 +02:00
committed by Diflow
parent 725399ac7c
commit 4b3c0466eb
2 changed files with 12 additions and 7 deletions

View File

@@ -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();