diff options
Diffstat (limited to 'src/palhm')
-rw-r--r-- | src/palhm/__init__.py | 4 | ||||
-rw-r--r-- | src/palhm/mod/aws.py | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/palhm/__init__.py b/src/palhm/__init__.py index 90de4fc..091d072 100644 --- a/src/palhm/__init__.py +++ b/src/palhm/__init__.py @@ -103,7 +103,9 @@ class GlobalContext: self.muas |= loaded.muas self.nb_workers = jobj.get("nb-workers", DEFAULT.NB_WORKERS.value) - if self.nb_workers < 0: + if self.nb_workers == 0: + self.nb_workers = default_workers() + elif self.nb_workers < 0: self.nb_workers = None if "vl" in jobj: self.vl = trans_vl(jobj["vl"]) diff --git a/src/palhm/mod/aws.py b/src/palhm/mod/aws.py index 74a0ea4..725861d 100644 --- a/src/palhm/mod/aws.py +++ b/src/palhm/mod/aws.py @@ -197,7 +197,7 @@ class S3BackupBackend (BackupBackend): def rollback (self, ctx: GlobalContext): if not self.cur_backup_uri is None: - self._rm_fs_recursive(ctx, [self.cur_backup_uri]) + self._rm_fs_recursive(ctx, [self.cur_backup_key]) def close (self, ctx: GlobalContext): self._cleanup_multiparts(ctx) @@ -226,12 +226,12 @@ class S3BackupBackend (BackupBackend): if self.sc_rot and self.sc_rot != self.sc_sink: def chsc (k): - self.client.copy_object( - Bucket = self.bucket, - CopySource = mks3objkey([self.bucket, k]), - Key = k, - MetadataDirective = "COPY", - StorageClass = self.sc_rot) + cp_src = { + "Bucket": self.bucket, + "Key": k + } + extra = { "StorageClass": self.sc_rot } + self.client.copy(cp_src, self.bucket, k, extra) with ThreadPoolExecutor(max_workers = ctx.nb_workers) as th_pool: l = self._logger(ctx) |