diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e1d09cbd68..191ddeff8ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - **Security Vulnerabilities** - Updated `@octokit/graphql` from 2.1.1 to ^2.3.0 to address [CVE-2024-21538] (https://github.com/advisories/GHSA-3xgq-45jj-v275) +- **Unit tests** ## [v19.1.0] 2024-10-07 diff --git a/packages/sftp-client/src/index.ts b/packages/sftp-client/src/index.ts index abe062b3262..e7173622607 100644 --- a/packages/sftp-client/src/index.ts +++ b/packages/sftp-client/src/index.ts @@ -145,7 +145,7 @@ export class SftpClient { log.info(`Copying ${remoteUrl} to ${s3uri}`); - const sftpReadStream = await this.sftp.createReadStream(remotePath); + const sftpReadStream = await this.sftp.createReadStream(remotePath, { autoClose: false }); const result = await S3.promiseS3Upload({ params: { @@ -157,6 +157,7 @@ export class SftpClient { }); log.info(`Finished copying ${remoteUrl} to ${s3uri}`); + sftpReadStream.destroy(); return { s3uri, etag: result.ETag }; }