diff --git a/config/storage.go b/config/storage.go index 2f29e37..0a2cf3b 100644 --- a/config/storage.go +++ b/config/storage.go @@ -32,6 +32,9 @@ type Storage struct { StorageRegion string `json:"storage_region" toml:"storage_region" yaml:"storage_region"` + // copy behaviour control option + StorageOptimizeCopy bool `json:"storage_optimize_copy" toml:"storage_optimize_copy" yaml:"storage_optimize_copy"` + // File storage default s3. Available: s3, fs StorageType string `json:"storage_type" toml:"storage_type" yaml:"storage_type"` diff --git a/pkg/proc/interaction.go b/pkg/proc/interaction.go index aa01198..6764a06 100644 --- a/pkg/proc/interaction.go +++ b/pkg/proc/interaction.go @@ -911,9 +911,14 @@ func ListFilesToCopy(prefix string, port uint64, cfg config.Storage, src storage path := strings.TrimPrefix(objectMetas[i].Path, cfg.StoragePrefix) reworked := path if _, ok := vi[reworked]; !ok { - ylogger.Zero.Info().Int("index", i).Str("object path", objectMetas[i].Path).Msg("not in virtual index, skipping...") + skipCopy := config.InstanceConfig().StorageCnf.StorageOptimizeCopy skipped = append(skipped, objectMetas[i]) - continue + + ylogger.Zero.Info().Int("index", i).Str("reworked name", reworked).Str("object path", objectMetas[i].Path).Bool("skipping", skipCopy).Msg("not in virtual index") + + if skipCopy { + continue + } } if sz, ok := copiedSizes[objectMetas[i].Path]; ok { ylogger.Zero.Info().