fix monitoring daily backpressure

This commit is contained in:
2026-06-27 15:31:08 +08:00
parent 58fe70268d
commit 940ac23493
10 changed files with 550 additions and 107 deletions
+8 -9
View File
@@ -344,20 +344,19 @@ func shutdownSchedulerMetricsServer(server *http.Server, logger interface {
}
func monitoringDailyRunOptions(jobCtx internalscheduler.JobRunContext) tenantapp.MonitoringDailyTaskRunOptions {
batchSize := 0
maxDesktopDispatch := 0
if jobCtx.Job != nil && jobCtx.Job.BatchSize != nil {
batchSize = *jobCtx.Job.BatchSize
maxDesktopDispatch = *jobCtx.Job.BatchSize
}
if batchSize <= 0 {
batchSize = internalscheduler.AsInt(jobCtx.Config, "max_materialize_per_run", 0)
if maxDesktopDispatch <= 0 {
maxDesktopDispatch = internalscheduler.AsInt(jobCtx.Config, "max_desktop_dispatch_per_run", 0)
}
if batchSize <= 0 {
batchSize = internalscheduler.AsInt(jobCtx.Config, "batch_size", 0)
if maxDesktopDispatch <= 0 {
maxDesktopDispatch = internalscheduler.AsInt(jobCtx.Config, "batch_size", 0)
}
return tenantapp.MonitoringDailyTaskRunOptions{
MaxMaterializePerRun: batchSize,
MaxMaterializePerPlan: internalscheduler.AsInt(jobCtx.Config, "max_materialize_per_plan", 0),
MaxMaterializePerBrand: internalscheduler.AsInt(jobCtx.Config, "max_materialize_per_brand", 0),
MaxDesktopDispatchPerRun: maxDesktopDispatch,
MaxDesktopClientBacklog: internalscheduler.AsInt(jobCtx.Config, "max_desktop_client_backlog", 0),
}
}