Skip to content

Commit 23d97eb

Browse files
committed
possible fix for #7796
1 parent 0c92213 commit 23d97eb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sled-agent/src/artifact_store.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,17 @@ impl<T: DatasetsManager> ArtifactStore<T> {
357357
}
358358
}
359359

360-
let temp_path =
361-
Utf8TempPath::from_path(temp_dir.join(sha256.to_string()));
360+
let temp_path = temp_dir.join(sha256.to_string());
362361
let file = match OpenOptions::new()
363362
.write(true)
364363
.create_new(true)
365364
.open(&temp_path)
366365
.await
367366
{
368-
Ok(file) => file,
367+
Ok(file) => NamedUtf8TempFile::from_parts(
368+
file,
369+
Utf8TempPath::from_path(temp_dir),
370+
),
369371
Err(err) => {
370372
if err.kind() == ErrorKind::AlreadyExists {
371373
return Err(Error::AlreadyInProgress { sha256 });
@@ -378,7 +380,6 @@ impl<T: DatasetsManager> ArtifactStore<T> {
378380
}
379381
}
380382
};
381-
let file = NamedUtf8TempFile::from_parts(file, temp_path);
382383

383384
files.push(Some((file, mountpoint)));
384385
}

0 commit comments

Comments
 (0)