Explorar el Código

Destroy streams handled by getReadyPipeline on error

Simon Detheridge hace 6 años
padre
commit
5fadafaf96
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  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)