diff options
author | Jürg Billeter <j@bitron.ch> | 2019-05-23 16:00:22 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-05-23 16:20:37 +0200 |
commit | fc5e3c33e2e36cd8f77d2897f701240356577879 (patch) | |
tree | 97569aaedf9cf089a730e66974ce7cbf1f897f13 | |
parent | b618670070027c892a84cd125dd028b708fb3c1b (diff) | |
download | buildstream-fc5e3c33e2e36cd8f77d2897f701240356577879.tar.gz |
_artifactcache.py: Create artifact proto file atomically
-rw-r--r-- | src/buildstream/_artifactcache.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buildstream/_artifactcache.py b/src/buildstream/_artifactcache.py index 091b44dda..91ff762c7 100644 --- a/src/buildstream/_artifactcache.py +++ b/src/buildstream/_artifactcache.py @@ -611,7 +611,7 @@ class ArtifactCache(BaseCache): # Write the artifact proto to cache artifact_path = os.path.join(self.artifactdir, request.cache_key) os.makedirs(os.path.dirname(artifact_path), exist_ok=True) - with open(artifact_path, 'w+b') as f: + with utils.save_file_atomic(artifact_path, mode='wb') as f: f.write(artifact.SerializeToString()) return True |