Skip to content

Commit 2c89396

Browse files
authored
fix: cannot delete the model with operation not permitted (#902)
Fixes #730 Signed-off-by: Jeff MAURY <[email protected]>
1 parent 9b4b559 commit 2c89396

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/backend/src/utils/downloader.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ export class Downloader {
8787
private followRedirects(url: string, callback: (message: { ok?: boolean; error?: string }) => void): void {
8888
const tmpFile = `${this.target}.tmp`;
8989

90-
const stream = createWriteStream(tmpFile, {
91-
signal: this.abortSignal,
92-
});
93-
9490
let totalFileSize = 0;
9591
let progress = 0;
9692
let previousProgressValue = -1;
@@ -106,6 +102,10 @@ export class Downloader {
106102
totalFileSize = parseFloat(resp.headers['content-length']);
107103
}
108104

105+
const stream = createWriteStream(tmpFile, {
106+
signal: this.abortSignal,
107+
});
108+
109109
// Capture potential errors
110110
resp.on('error', (err: Error) => {
111111
stream.destroy(err); // propagate to stream

0 commit comments

Comments
 (0)