Skip to content

Commit

Permalink
add patch flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Snopov authored and vitalif committed Nov 22, 2023
1 parent 2f9b484 commit 36cfc1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/cfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ type FlagStorage struct {
MaxDiskCacheFD int64
CacheFileMode os.FileMode
PartSizes []PartSizeConfig
UsePatch bool
DropPatchConflicts bool

// Debugging
DebugMain bool
Expand Down
14 changes: 13 additions & 1 deletion internal/cfg/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,16 @@ MISC OPTIONS:
" and then 125 MB for the rest of parts",
},

cli.BoolFlag{
Name: "enable-patch",
Usage: "Use PATCH method to upload object data changes to s3. Yandex only. (default: off)",
},

cli.BoolFlag{
Name: "drop-patch-conflicts",
Usage: "Drop local changes in case of conflicting concurrent PATCH updates. (default: off)",
},

cli.IntFlag{
Name: "max-merge-copy",
Value: 0,
Expand Down Expand Up @@ -823,6 +833,8 @@ func PopulateFlags(c *cli.Context) (ret *FlagStorage) {
CachePath: c.String("cache"),
MaxDiskCacheFD: int64(c.Int("max-disk-cache-fd")),
CacheFileMode: os.FileMode(c.Int("cache-file-mode")),
UsePatch: c.Bool("enable-patch"),
DropPatchConflicts: c.Bool("drop-patch-conflicts"),

// Common Backend Config
Endpoint: c.String("endpoint"),
Expand Down Expand Up @@ -886,7 +898,7 @@ func PopulateFlags(c *cli.Context) (ret *FlagStorage) {
panic("Unknown --iam-flavor: "+config.IAMFlavor)
}
listType := c.String("list-type")
isYandex := strings.Index(flags.Endpoint, "yandex") != -1
isYandex := strings.Contains(flags.Endpoint, "yandex")
if isYandex && !c.IsSet("no-specials") {
flags.EnableSpecials = true
}
Expand Down

0 comments on commit 36cfc1e

Please sign in to comment.