Skip to content

Commit 155e979

Browse files
committed
w
1 parent a214fc1 commit 155e979

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

prime_backup/action/helpers/blob_allocator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ def __try_get_or_create_chunked_blob(self, src_path: Path, src_path_md5: str, st
448448
src_path, st.st_size, pre_cal_result.simple_repr(),
449449
))
450450
pre_cal_result = None
451-
previous_chunks = self.__previous_chunks_getter(src_path) if chunk_method.needs_previous_chunks() else None
452451

453452
with contextlib.ExitStack() as es:
454453
if policy == _ChunkedBlobCreatePolicy.default:
@@ -471,6 +470,7 @@ def __try_get_or_create_chunked_blob(self, src_path: Path, src_path_md5: str, st
471470
src_path_str, ByteCount(blob_size).auto_str(), len(chunks), chunk_method.name,
472471
))
473472
else:
473+
previous_chunks = self.__previous_chunks_getter(src_path) if chunk_method.needs_previous_chunks() else None
474474
chunker = chunk_method.create_file_chunker(actual_path_to_read, need_entire_file_hash=True, previous_chunks=previous_chunks)
475475
with self.__time_costs.measure_time_cost(CreateBackupTimeCostKey.kind_io_read) as chunking_cost:
476476
chunks = chunker.cut_all()

prime_backup/types/chunker.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import dataclasses
22
import logging
33
from abc import abstractmethod, ABC
4-
from collections.abc import Iterable
54
from pathlib import Path
6-
from typing import TYPE_CHECKING, List, Generator, IO, Optional, Iterable as TypingIterable, Dict
5+
from typing import TYPE_CHECKING, List, Generator, IO, Optional, Iterable, Dict
76

87
from typing_extensions import override
98

@@ -182,7 +181,7 @@ class FixedAutoFileChunker(Chunker):
182181
def __init__(
183182
self,
184183
file_path: Path,
185-
previous_chunks: Optional[TypingIterable[PrettyChunk]] = None,
184+
previous_chunks: Optional[Iterable[PrettyChunk]] = None,
186185
need_entire_file_hash: bool = False,
187186
):
188187
super().__init__(need_entire_file_hash)

0 commit comments

Comments
 (0)