Skip to content

Commit 7253f0f

Browse files
authored
feat: increase interval of the preheat polling (#3544)
Signed-off-by: Gaius <gaius.qi@gmail.com>
1 parent 7a83e5a commit 7253f0f

13 files changed

+57
-2
lines changed

manager/router/router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func Init(cfg *config.Config, logDir string, service service.Service, database *
212212
job.POST("", middlewares.RateLimit(cfg.Job.RateLimit.FillInterval, cfg.Job.RateLimit.Capacity, cfg.Job.RateLimit.Quantum), h.CreateJob)
213213
job.DELETE(":id", h.DestroyJob)
214214
job.PATCH(":id", h.UpdateJob)
215-
job.GET(":id", h.GetJob)
215+
job.GET(":id", middlewares.RateLimit(cfg.Job.RateLimit.FillInterval, cfg.Job.RateLimit.Capacity, cfg.Job.RateLimit.Quantum), h.GetJob)
216216
job.GET("", h.GetJobs)
217217

218218
// Application.

manager/service/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ func (s *service) pollingJob(ctx context.Context, name string, id uint, groupID
288288
job models.Job
289289
log = logger.WithGroupAndJobID(groupID, fmt.Sprint(id))
290290
)
291-
if _, _, err := retry.Run(ctx, 5, 10, 480, func() (any, bool, error) {
291+
if _, _, err := retry.Run(ctx, 30, 300, 16, func() (any, bool, error) {
292292
groupJob, err := s.job.GetGroupJobState(name, groupID)
293293
if err != nil {
294294
log.Errorf("polling group failed: %s", err.Error())

test/testdata/charts/config-cache-list-metadata.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,8 @@ manager:
152152
enable: true
153153
config:
154154
verbose: true
155+
job:
156+
rateLimit:
157+
fillInterval: 1m
158+
capacity: 100
159+
quantum: 100

test/testdata/charts/config-compatibility.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ manager:
149149
enable: true
150150
config:
151151
verbose: true
152+
job:
153+
rateLimit:
154+
fillInterval: 1m
155+
capacity: 100
156+
quantum: 100
152157
cache:
153158
redis:
154159
ttl: 1m

test/testdata/charts/config-concurent-back-source.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,8 @@ manager:
157157
enable: true
158158
config:
159159
verbose: true
160+
job:
161+
rateLimit:
162+
fillInterval: 1m
163+
capacity: 100
164+
quantum: 100

test/testdata/charts/config-disable-seed-peer.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,8 @@ manager:
121121
enable: true
122122
config:
123123
verbose: true
124+
job:
125+
rateLimit:
126+
fillInterval: 1m
127+
capacity: 100
128+
quantum: 100

test/testdata/charts/config-grpc-tls-ipv6.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ manager:
274274
enable: true
275275
config:
276276
verbose: true
277+
job:
278+
rateLimit:
279+
fillInterval: 1m
280+
capacity: 100
281+
quantum: 100
277282
security:
278283
autoIssueCert: true
279284
tlsPolicy: prefer

test/testdata/charts/config-grpc-tls.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ manager:
268268
enable: true
269269
config:
270270
verbose: true
271+
job:
272+
rateLimit:
273+
fillInterval: 1m
274+
capacity: 100
275+
quantum: 100
271276
security:
272277
autoIssueCert: true
273278
tlsPolicy: prefer

test/testdata/charts/config-ipv6.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,8 @@ manager:
157157
verbose: true
158158
network:
159159
enableIPv6: true
160+
job:
161+
rateLimit:
162+
fillInterval: 1m
163+
capacity: 100
164+
quantum: 100

test/testdata/charts/config-split-running-tasks.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,8 @@ manager:
150150
enable: true
151151
config:
152152
verbose: true
153+
job:
154+
rateLimit:
155+
fillInterval: 1m
156+
capacity: 100
157+
quantum: 100

0 commit comments

Comments
 (0)