From d4911ea2466db0d2cbac36dc37037ccf3f53639e Mon Sep 17 00:00:00 2001 From: andrew rumble Date: Wed, 4 Sep 2024 12:23:27 +0100 Subject: [PATCH] Stop waiting for finalize Finalize promise will only resolve when the archive is closed. We want to stream as soon as we have the data so this does not suit us. We want to log errors that are thrown due to finalize, these should be propogated by archiver to the response already. GitOrigin-RevId: 4f9d727a00ead1be3caee62e1e0adba069a545c7 --- services/clsi/app/js/OutputFileArchiveManager.js | 7 ++++++- .../clsi/test/unit/js/OutputFileArchiveManagerTests.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/services/clsi/app/js/OutputFileArchiveManager.js b/services/clsi/app/js/OutputFileArchiveManager.js index 4227ecb7c7..cc5253ad4c 100644 --- a/services/clsi/app/js/OutputFileArchiveManager.js +++ b/services/clsi/app/js/OutputFileArchiveManager.js @@ -65,7 +65,12 @@ module.exports = { }) } - await archive.finalize() + archive.finalize().catch(error => { + logger.error( + { error, projectId, userId, build }, + 'error finalizing output files archive' + ) + }) return archive }, diff --git a/services/clsi/test/unit/js/OutputFileArchiveManagerTests.js b/services/clsi/test/unit/js/OutputFileArchiveManagerTests.js index 6eeb3637c6..bd62b00825 100644 --- a/services/clsi/test/unit/js/OutputFileArchiveManagerTests.js +++ b/services/clsi/test/unit/js/OutputFileArchiveManagerTests.js @@ -31,7 +31,7 @@ describe('OutputFileArchiveManager', function () { this.archive = { append: sinon.stub(), - finalize: sinon.stub(), + finalize: sinon.stub().resolves(), on: sinon.stub(), }