mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-04 06:21:46 +00:00
fix AdHocCache.add_chunk signature (ctype, clevel kwargs)
This commit is contained in:
parent
17fce18b44
commit
de342581d6
1 changed files with 17 additions and 2 deletions
|
@ -1160,7 +1160,20 @@ def file_known_and_unchanged(self, hashed_path, path_hash, st):
|
|||
def memorize_file(self, hashed_path, path_hash, st, chunks):
|
||||
pass
|
||||
|
||||
def add_chunk(self, id, meta, data, *, stats, wait=True, compress=True, size=None, ro_type=ROBJ_FILE_STREAM):
|
||||
def add_chunk(
|
||||
self,
|
||||
id,
|
||||
meta,
|
||||
data,
|
||||
*,
|
||||
stats,
|
||||
wait=True,
|
||||
compress=True,
|
||||
size=None,
|
||||
ctype=None,
|
||||
clevel=None,
|
||||
ro_type=ROBJ_FILE_STREAM,
|
||||
):
|
||||
assert ro_type is not None
|
||||
if not self._txn_active:
|
||||
self.begin_txn()
|
||||
|
@ -1172,7 +1185,9 @@ def add_chunk(self, id, meta, data, *, stats, wait=True, compress=True, size=Non
|
|||
refcount = self.seen_chunk(id, size)
|
||||
if refcount:
|
||||
return self.chunk_incref(id, size, stats)
|
||||
cdata = self.repo_objs.format(id, meta, data, compress=compress, ro_type=ro_type)
|
||||
cdata = self.repo_objs.format(
|
||||
id, meta, data, compress=compress, size=size, ctype=ctype, clevel=clevel, ro_type=ro_type
|
||||
)
|
||||
self.repository.put(id, cdata, wait=wait)
|
||||
self.chunks.add(id, 1, size)
|
||||
stats.update(size, not refcount)
|
||||
|
|
Loading…
Reference in a new issue