Add automatic storage replication
Adds a worker to automatically replicate data between storages and update the database accordingly
This commit is contained in:
parent
c693afca6a
commit
724b1607d7
18 changed files with 259 additions and 35 deletions
|
@ -112,11 +112,9 @@ class LocalStorage(BaseStorageV2):
|
|||
sha_hash.update(buf)
|
||||
return sha_hash.hexdigest()[:7]
|
||||
|
||||
|
||||
def _rel_upload_path(self, uuid):
|
||||
return 'uploads/{0}'.format(uuid)
|
||||
|
||||
|
||||
def initiate_chunked_upload(self):
|
||||
new_uuid = str(uuid4())
|
||||
|
||||
|
@ -162,3 +160,7 @@ class LocalStorage(BaseStorageV2):
|
|||
raise Exception('Storage path %s is not under a mounted volume.\n\n'
|
||||
'Registry data must be stored under a mounted volume '
|
||||
'to prevent data loss' % self._root_path)
|
||||
|
||||
def copy_to(self, destination, path):
|
||||
with self.stream_read_file(path) as fp:
|
||||
destination.stream_write(path, fp)
|
||||
|
|
Reference in a new issue