Skip to content

Commit 261309d

Browse files
committed
ImageStore: write state.json atomically
1 parent b9c65e5 commit 261309d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/Containerization/Image/ImageStore/ImageStore+ReferenceManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extension ImageStore {
4949

5050
private func save(_ state: State) throws {
5151
let statePath = self.path.appendingPathComponent("state.json")
52-
try JSONEncoder().encode(state).write(to: statePath)
52+
try JSONEncoder().encode(state).write(to: statePath, options: .atomic)
5353
}
5454

5555
public func delete(reference: String) throws {

0 commit comments

Comments
 (0)