mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-30 18:41:49 -07:00
Using default priority weight if not specified (#7954)
## What changed? - Using default priority weight if not specified ## Why? - In case new priority levels got introduced and break existing things ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s)
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
DefaultPriorityWeight = 1
|
||||
|
||||
DefaultActiveTaskPriorityWeight = map[tasks.Priority]int{
|
||||
tasks.PriorityHigh: 10,
|
||||
tasks.PriorityLow: 9,
|
||||
|
||||
@@ -106,10 +106,19 @@ func NewScheduler(
|
||||
)
|
||||
}
|
||||
|
||||
return configs.ConvertDynamicConfigValueToWeights(
|
||||
weight, ok := configs.ConvertDynamicConfigValueToWeights(
|
||||
namespaceWeights(namespaceName.String()),
|
||||
logger,
|
||||
)[key.Priority]
|
||||
if !ok || weight <= 0 {
|
||||
logger.Warn("Task priority weight not specified or is invalid, using default weight",
|
||||
tag.TaskPriority(key.Priority.String()),
|
||||
tag.NewInt("priority-weight", weight),
|
||||
tag.NewInt("default-weight", configs.DefaultPriorityWeight),
|
||||
)
|
||||
weight = configs.DefaultPriorityWeight
|
||||
}
|
||||
return weight
|
||||
}
|
||||
channelWeightUpdateCh := make(chan struct{}, 1)
|
||||
fifoSchedulerOptions := &tasks.FIFOSchedulerOptions{
|
||||
|
||||
Reference in New Issue
Block a user