From 5fadafaf961732012052b856c077b50f10c3636a Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Mon, 30 Mar 2020 17:14:46 +0100 Subject: [PATCH] Destroy streams handled by getReadyPipeline on error --- services/filestore/app/js/PersistorHelper.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/filestore/app/js/PersistorHelper.js b/services/filestore/app/js/PersistorHelper.js index f2d0013915..826412b302 100644 --- a/services/filestore/app/js/PersistorHelper.js +++ b/services/filestore/app/js/PersistorHelper.js @@ -112,6 +112,11 @@ function getReadyPipeline(...streams) { } resolve(lastStream) } + if (err) { + for (const stream of streams) { + stream.destroy() + } + } } pipeline(...streams).catch(handler)