Skip to content

Commit

Permalink
use concurrency in gc run
Browse files Browse the repository at this point in the history
  • Loading branch information
hemanth132 committed Apr 22, 2023
1 parent c453e6e commit 12f50f9
Show file tree
Hide file tree
Showing 11 changed files with 440 additions and 144 deletions.
3 changes: 3 additions & 0 deletions src/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ const (
// DefaultGCTimeWindowHours is the reserve blob time window used by GC, default is 2 hours
DefaultGCTimeWindowHours = int64(2)

// DefaultGcDeleteConcurrency is the delete concurrency within a gc run
DefaultGcDeleteConcurrency = int64(1)

// Metric setting items
MetricEnable = "metric_enable"
MetricPort = "metric_port"
Expand Down
1 change: 1 addition & 0 deletions src/controller/gc/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (c *controller) Start(ctx context.Context, policy Policy, trigger string) (
para["dry_run"] = policy.DryRun
para["redis_url_reg"] = policy.ExtraAttrs["redis_url_reg"]
para["time_window"] = policy.ExtraAttrs["time_window"]
para["delete_concurrency"] = policy.ExtraAttrs["delete_concurrency"]

execID, err := c.exeMgr.Create(ctx, job.GarbageCollectionVendorType, -1, trigger, para)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ require (

require (
github.com/beego/beego/v2 v2.0.6
golang.org/x/sync v0.1.0
golang.org/x/text v0.9.0
)

Expand Down
2 changes: 2 additions & 0 deletions src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
Loading

0 comments on commit 12f50f9

Please sign in to comment.