fix: close IO sink after download finishes or fails (#2561)

This commit is contained in:
Bryan Oltman
2024-10-21 10:55:46 -04:00
committed by GitHub
parent 36df64b46f
commit 8141444a4e
@@ -79,7 +79,12 @@ class ArtifactManager {
outFile.createSync();
}
await outFile.openWrite().addStream(response.stream);
final ioSink = outFile.openWrite();
try {
await ioSink.addStream(response.stream);
} finally {
await ioSink.close();
}
return outFile;
}