##// END OF EJS Templates
feat(disk-cache): use fsync to force flush changes on NFS, and use retry mechanism to archive caches...
super-admin -
r5427:e472f015 default
parent child Browse files
Show More
@@ -459,7 +459,7 b' class RepoFilesView(RepoAppView):'
459 459 response.location = location
460 460 return response
461 461
462 reader, metadata = d_cache.fetch(archive_name_key)
462 reader, metadata = d_cache.fetch(archive_name_key, retry=True, retry_attempts=30)
463 463
464 464 response = Response(app_iter=archive_iterator(reader))
465 465 response.content_disposition = f'attachment; filename={response_archive_name}'
@@ -139,6 +139,13 b' class FileSystemCache:'
139 139 for chunk in iterator:
140 140 size += len(chunk)
141 141 writer.write(chunk)
142 writer.flush()
143 # Get the file descriptor
144 fd = writer.fileno()
145
146 # Sync the file descriptor to disk, helps with NFS cases...
147 os.fsync(fd)
148 log.debug('written new archive cache under %s', full_path)
142 149 return size
143 150
144 151 def _get_keyfile(self, key):
General Comments 0
You need to be logged in to leave comments. Login now