rclone-api 1.2.14__tar.gz → 1.2.154__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rclone_api-1.2.14 → rclone_api-1.2.154}/PKG-INFO +1 -1
- {rclone_api-1.2.14 → rclone_api-1.2.154}/pyproject.toml +1 -1
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/__init__.py +45 -38
- rclone_api-1.2.154/src/rclone_api/logging.py +39 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/s3/chunk_file.py +146 -145
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api.egg-info/PKG-INFO +1 -1
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api.egg-info/SOURCES.txt +1 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.aiderignore +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.github/workflows/lint.yml +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.github/workflows/push_macos.yml +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.github/workflows/push_ubuntu.yml +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.github/workflows/push_win.yml +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.gitignore +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.pylintrc +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.vscode/launch.json +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.vscode/settings.json +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/.vscode/tasks.json +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/LICENSE +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/MANIFEST.in +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/README.md +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/clean +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/install +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/lint +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/requirements.testing.txt +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/setup.cfg +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/setup.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/assets/example.txt +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/cli.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/cmd/copy_large_s3.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/cmd/list_files.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/completed_process.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/config.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/convert.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/deprecated.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/diff.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/dir.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/dir_listing.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/exec.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/experimental/flags.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/experimental/flags_base.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/file.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/filelist.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/group_files.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/mount.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/mount_read_chunker.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/process.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/profile/mount_copy_bytes.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/rclone.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/remote.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/rpath.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/s3/api.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/s3/basic_ops.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/s3/chunk_types.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/s3/create.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/s3/types.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/s3/upload_file_multipart.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/scan_missing_folders.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/types.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/util.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api/walk.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api.egg-info/dependency_links.txt +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api.egg-info/entry_points.txt +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api.egg-info/requires.txt +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/src/rclone_api.egg-info/top_level.txt +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/test +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/archive/test_paramiko.py.disabled +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_cmd_list_files.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_copy.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_copy_bytes.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_copy_file_resumable_s3.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_copy_files.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_diff.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_group_files.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_is_synced.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_ls.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_mount.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_mount_s3.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_obscure.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_rclone_config.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_remote_control.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_remotes.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_s3.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_scan_missing_folders.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_size_files.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_size_suffix.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tests/test_walk.py +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/tox.ini +0 -0
- {rclone_api-1.2.14 → rclone_api-1.2.154}/upload_package.sh +0 -0
|
@@ -1,38 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
from .
|
|
5
|
-
from .
|
|
6
|
-
from .
|
|
7
|
-
from .
|
|
8
|
-
from .
|
|
9
|
-
from .
|
|
10
|
-
from .
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
from .
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
1
|
+
# Import logging module to activate default configuration
|
|
2
|
+
import rclone_api.logging # noqa: F401
|
|
3
|
+
|
|
4
|
+
from .completed_process import CompletedProcess
|
|
5
|
+
from .config import Config, Parsed, Section
|
|
6
|
+
from .diff import DiffItem, DiffOption, DiffType
|
|
7
|
+
from .dir import Dir
|
|
8
|
+
from .dir_listing import DirListing
|
|
9
|
+
from .file import File
|
|
10
|
+
from .filelist import FileList
|
|
11
|
+
|
|
12
|
+
# Import the configure_logging function to make it available at package level
|
|
13
|
+
from .logging import configure_logging
|
|
14
|
+
from .process import Process
|
|
15
|
+
from .rclone import Rclone, rclone_verbose
|
|
16
|
+
from .remote import Remote
|
|
17
|
+
from .rpath import RPath
|
|
18
|
+
from .s3.types import MultiUploadResult
|
|
19
|
+
from .types import ListingOption, Order, SizeResult, SizeSuffix
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"Rclone",
|
|
23
|
+
"File",
|
|
24
|
+
"Config",
|
|
25
|
+
"Remote",
|
|
26
|
+
"Dir",
|
|
27
|
+
"RPath",
|
|
28
|
+
"DirListing",
|
|
29
|
+
"FileList",
|
|
30
|
+
"Process",
|
|
31
|
+
"DiffItem",
|
|
32
|
+
"DiffType",
|
|
33
|
+
"rclone_verbose",
|
|
34
|
+
"CompletedProcess",
|
|
35
|
+
"DiffOption",
|
|
36
|
+
"ListingOption",
|
|
37
|
+
"Order",
|
|
38
|
+
"ListingOption",
|
|
39
|
+
"SizeResult",
|
|
40
|
+
"Parsed",
|
|
41
|
+
"Section",
|
|
42
|
+
"MultiUploadResult",
|
|
43
|
+
"SizeSuffix",
|
|
44
|
+
"configure_logging",
|
|
45
|
+
]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def setup_default_logging():
|
|
6
|
+
"""Set up default logging configuration if none exists."""
|
|
7
|
+
if not logging.root.handlers:
|
|
8
|
+
logging.basicConfig(
|
|
9
|
+
level=logging.INFO,
|
|
10
|
+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
11
|
+
handlers=[
|
|
12
|
+
logging.StreamHandler(sys.stdout),
|
|
13
|
+
# Uncomment to add file logging
|
|
14
|
+
# logging.FileHandler('rclone_api.log')
|
|
15
|
+
],
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def configure_logging(level=logging.INFO, log_file=None):
|
|
20
|
+
"""Configure logging for the rclone_api package.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
level: The logging level (default: logging.INFO)
|
|
24
|
+
log_file: Optional path to a log file
|
|
25
|
+
"""
|
|
26
|
+
handlers = [logging.StreamHandler(sys.stdout)]
|
|
27
|
+
if log_file:
|
|
28
|
+
handlers.append(logging.FileHandler(log_file))
|
|
29
|
+
|
|
30
|
+
logging.basicConfig(
|
|
31
|
+
level=level,
|
|
32
|
+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
33
|
+
handlers=handlers,
|
|
34
|
+
force=True, # Override any existing configuration
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# Call setup_default_logging when this module is imported
|
|
39
|
+
setup_default_logging()
|
|
@@ -1,145 +1,146 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
from concurrent.futures import Future
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
from queue import Queue
|
|
7
|
-
from threading import Event
|
|
8
|
-
from typing import Any, Callable
|
|
9
|
-
|
|
10
|
-
from rclone_api.mount_read_chunker import FilePart
|
|
11
|
-
from rclone_api.s3.chunk_types import UploadState
|
|
12
|
-
from rclone_api.types import EndOfStream
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1
|
+
import logging
|
|
2
|
+
import time
|
|
3
|
+
from concurrent.futures import Future
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from queue import Queue
|
|
7
|
+
from threading import Event
|
|
8
|
+
from typing import Any, Callable
|
|
9
|
+
|
|
10
|
+
from rclone_api.mount_read_chunker import FilePart
|
|
11
|
+
from rclone_api.s3.chunk_types import UploadState
|
|
12
|
+
from rclone_api.types import EndOfStream
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__) # noqa
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_file_size(file_path: Path, timeout: int = 60) -> int:
|
|
18
|
+
sleep_time = timeout / 60 if timeout > 0 else 1
|
|
19
|
+
start = time.time()
|
|
20
|
+
while True:
|
|
21
|
+
expired = time.time() - start > timeout
|
|
22
|
+
try:
|
|
23
|
+
time.sleep(sleep_time)
|
|
24
|
+
if file_path.exists():
|
|
25
|
+
return file_path.stat().st_size
|
|
26
|
+
except FileNotFoundError as e:
|
|
27
|
+
if expired:
|
|
28
|
+
print(f"File not found: {file_path}, exception is {e}")
|
|
29
|
+
raise
|
|
30
|
+
if expired:
|
|
31
|
+
raise TimeoutError(f"File {file_path} not found after {timeout} seconds")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass
|
|
35
|
+
class S3FileInfo:
|
|
36
|
+
upload_id: str
|
|
37
|
+
part_number: int
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def file_chunker(
|
|
41
|
+
upload_state: UploadState,
|
|
42
|
+
fetcher: Callable[[int, int, Any], Future[FilePart]],
|
|
43
|
+
max_chunks: int | None,
|
|
44
|
+
cancel_signal: Event,
|
|
45
|
+
queue_upload: Queue[FilePart | EndOfStream],
|
|
46
|
+
) -> None:
|
|
47
|
+
count = 0
|
|
48
|
+
|
|
49
|
+
def should_stop() -> bool:
|
|
50
|
+
nonlocal count
|
|
51
|
+
|
|
52
|
+
if max_chunks is None:
|
|
53
|
+
return False
|
|
54
|
+
if count >= max_chunks:
|
|
55
|
+
logger.info(
|
|
56
|
+
f"Stopping file chunker after {count} chunks because it exceeded max_chunks {max_chunks}"
|
|
57
|
+
)
|
|
58
|
+
return True
|
|
59
|
+
count += 1
|
|
60
|
+
return False
|
|
61
|
+
|
|
62
|
+
upload_info = upload_state.upload_info
|
|
63
|
+
file_path = upload_info.src_file_path
|
|
64
|
+
chunk_size = upload_info.chunk_size
|
|
65
|
+
# src = Path(file_path)
|
|
66
|
+
|
|
67
|
+
try:
|
|
68
|
+
part_number = 1
|
|
69
|
+
done_part_numbers: set[int] = {
|
|
70
|
+
p.part_number for p in upload_state.parts if not isinstance(p, EndOfStream)
|
|
71
|
+
}
|
|
72
|
+
num_parts = upload_info.total_chunks()
|
|
73
|
+
|
|
74
|
+
def next_part_number() -> int | None:
|
|
75
|
+
nonlocal part_number
|
|
76
|
+
while part_number in done_part_numbers:
|
|
77
|
+
part_number += 1
|
|
78
|
+
if part_number > num_parts:
|
|
79
|
+
return None
|
|
80
|
+
return part_number
|
|
81
|
+
|
|
82
|
+
if cancel_signal.is_set():
|
|
83
|
+
logger.info(
|
|
84
|
+
f"Cancel signal is set for file chunker while processing {file_path}, returning"
|
|
85
|
+
)
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
while not should_stop():
|
|
89
|
+
logger.debug("Processing next chunk")
|
|
90
|
+
curr_part_number = next_part_number()
|
|
91
|
+
if curr_part_number is None:
|
|
92
|
+
logger.info(f"File {file_path} has completed chunking all parts")
|
|
93
|
+
break
|
|
94
|
+
assert curr_part_number is not None
|
|
95
|
+
offset = (curr_part_number - 1) * chunk_size
|
|
96
|
+
file_size = upload_info.file_size
|
|
97
|
+
|
|
98
|
+
assert offset < file_size, f"Offset {offset} is greater than file size"
|
|
99
|
+
|
|
100
|
+
# Open the file, seek, read the chunk, and close immediately.
|
|
101
|
+
# with open(file_path, "rb") as f:
|
|
102
|
+
# f.seek(offset)
|
|
103
|
+
# data = f.read(chunk_size)
|
|
104
|
+
|
|
105
|
+
# data = chunk_fetcher(offset, chunk_size).result()
|
|
106
|
+
|
|
107
|
+
assert curr_part_number is not None
|
|
108
|
+
cpn: int = curr_part_number
|
|
109
|
+
|
|
110
|
+
def on_complete(fut: Future[FilePart]) -> None:
|
|
111
|
+
logger.debug("Chunk read complete")
|
|
112
|
+
fp: FilePart = fut.result()
|
|
113
|
+
if fp.is_error():
|
|
114
|
+
logger.warning(
|
|
115
|
+
f"Error reading file: {fp}, skipping part {part_number}"
|
|
116
|
+
)
|
|
117
|
+
return
|
|
118
|
+
|
|
119
|
+
if fp.n_bytes() == 0:
|
|
120
|
+
logger.warning(f"Empty data for part {part_number} of {file_path}")
|
|
121
|
+
raise ValueError(
|
|
122
|
+
f"Empty data for part {part_number} of {file_path}"
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
if isinstance(fp.payload, Exception):
|
|
126
|
+
logger.warning(f"Error reading file because of error: {fp.payload}")
|
|
127
|
+
return
|
|
128
|
+
|
|
129
|
+
done_part_numbers.add(part_number)
|
|
130
|
+
queue_upload.put(fp)
|
|
131
|
+
|
|
132
|
+
offset = (curr_part_number - 1) * chunk_size
|
|
133
|
+
logger.info(
|
|
134
|
+
f"Reading chunk {curr_part_number} of {num_parts} for {file_path}"
|
|
135
|
+
)
|
|
136
|
+
fut = fetcher(offset, file_size, S3FileInfo(upload_info.upload_id, cpn))
|
|
137
|
+
fut.add_done_callback(on_complete)
|
|
138
|
+
# wait until the queue_upload queue can accept the next chunk
|
|
139
|
+
while queue_upload.full():
|
|
140
|
+
time.sleep(0.1)
|
|
141
|
+
except Exception as e:
|
|
142
|
+
|
|
143
|
+
logger.error(f"Error reading file: {e}", exc_info=True)
|
|
144
|
+
finally:
|
|
145
|
+
logger.info(f"Finishing FILE CHUNKER for {file_path} and adding EndOfStream")
|
|
146
|
+
queue_upload.put(EndOfStream())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|