Parcourir la source

Destroy streams handled by getReadyPipeline on error

Simon Detheridge il y a 6 ans
Parent
commit
5fadafaf96
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      services/filestore/app/js/PersistorHelper.js

+ 5 - 0
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)