Skip to content

Commit 752845f

Browse files
committed
Release 2.1.5
1 parent 53f2c4f commit 752845f

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mage-db-sync",
3-
"version": "2.1.4",
3+
"version": "2.1.5",
44
"description": "Database synchronizer for Magento, based on Magerun",
55
"license": "MIT",
66
"author": {

src/controllers/StartController.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class StartController extends MainController {
3333

3434
await this.showCompletionMessage();
3535

36-
await SSHConnectionPool.closeAll();
37-
3836
process.exit(0);
3937
} catch (e) {
4038
const error = e as Error;
@@ -44,7 +42,13 @@ class StartController extends MainController {
4442
console.log('\n' + error.stack);
4543
}
4644

47-
await SSHConnectionPool.closeAll();
45+
// Try to close SSH connections on error (might already be closed)
46+
try {
47+
await SSHConnectionPool.closeAll();
48+
} catch (_cleanupError) {
49+
// Ignore cleanup errors during error handling
50+
}
51+
4852
process.exit(1);
4953
}
5054
};

src/tasks/DownloadTask.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ class DownloadTask {
12201220
}
12211221

12221222
this.downloadTasks.push({
1223-
title: 'Cleaning up and closing SSH connection',
1223+
title: 'Cleaning up remote files',
12241224
task: async (): Promise<void> => {
12251225
PerformanceMonitor.start('cleanup');
12261226
const logger = this.services.getLogger();
@@ -1254,6 +1254,17 @@ class DownloadTask {
12541254
PerformanceMonitor.end('cleanup');
12551255
}
12561256
});
1257+
1258+
// Close SSH connections as final step - no longer needed after download
1259+
this.downloadTasks.push({
1260+
title: 'Closing SSH connections',
1261+
task: async (): Promise<void> => {
1262+
const logger = this.services.getLogger();
1263+
logger.info('Closing SSH connections after download');
1264+
await SSHConnectionPool.closeAll();
1265+
logger.info('SSH connections closed successfully');
1266+
}
1267+
});
12571268
};
12581269
}
12591270

0 commit comments

Comments
 (0)