Skip to content

Commit 6e039ab

Browse files
committed
feat(gooddata-pipelines): Configurable parallelism of backup
1 parent 9b24663 commit 6e039ab

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

gooddata-pipelines/gooddata_pipelines/backup_and_restore/backup_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def _process_batches_in_parallel(
347347
stop_event = threading.Event()
348348

349349
with ThreadPoolExecutor(
350-
max_workers=BackupSettings.MAX_WORKERS
350+
max_workers=self.config.max_workers
351351
) as executor:
352352
# Set the futures tasks.
353353
futures = []

gooddata-pipelines/gooddata_pipelines/backup_and_restore/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# (C) 2025 GoodData Corporation
12
import datetime
23
from dataclasses import dataclass
34

@@ -22,7 +23,7 @@ class DirNames:
2223

2324
@dataclass(frozen=True)
2425
class ConcurrencyDefaults:
25-
MAX_WORKERS = 2
26+
MAX_WORKERS = 1
2627
DEFAULT_BATCH_SIZE = 100
2728

2829

gooddata-pipelines/gooddata_pipelines/backup_and_restore/models/storage.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ class BackupRestoreConfig(BaseModel):
8383
description="Batch size must be greater than 0",
8484
),
8585
] = Field(default=BackupSettings.DEFAULT_BATCH_SIZE)
86+
max_workers: Annotated[
87+
int,
88+
Field(
89+
gt=0,
90+
lt=3,
91+
description="Max workers must be greater than 0 and less than 3",
92+
),
93+
] = Field(default=BackupSettings.MAX_WORKERS)
8694

8795
@classmethod
8896
def from_yaml(cls, conf_path: str) -> "BackupRestoreConfig":

0 commit comments

Comments
 (0)