summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildstream/_artifactcache/artifactcache.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py
index adfc07748..654b675a2 100644
--- a/buildstream/_artifactcache/artifactcache.py
+++ b/buildstream/_artifactcache/artifactcache.py
@@ -571,7 +571,7 @@ class ArtifactCache():
def _write_cache_size(self, size):
assert isinstance(size, int)
size_file_path = os.path.join(self.context.artifactdir, CACHE_SIZE_FILE)
- with open(size_file_path, "w") as f:
+ with utils.save_file_atomic(size_file_path, "w") as f:
f.write(str(size))
# _read_cache_size()