mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(scheduler): add session usage timeout options (#23142)
This commit is contained in:
@@ -29,6 +29,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db/quotas"
|
||||
computemodels "yunion.io/x/onecloud/pkg/compute/models"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/api"
|
||||
"yunion.io/x/onecloud/pkg/scheduler/options"
|
||||
)
|
||||
|
||||
var HostPendingUsageManager *SHostPendingUsageManager
|
||||
@@ -527,7 +528,7 @@ func (self *SessionPendingUsage) cancelSelf() {
|
||||
}
|
||||
|
||||
func (self *SessionPendingUsage) StartTimer() {
|
||||
timeout := 1 * time.Minute
|
||||
timeout := time.Duration(options.Options.ExpireSessionUsageTimeout) * time.Second
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
|
||||
@@ -52,6 +52,8 @@ type SchedOptions struct {
|
||||
ExpireQueueMaxLength int `help:"Expire queue max length" default:"1000"`
|
||||
ExpireQueueDealLength int `help:"Expire queue deal length" default:"100"`
|
||||
|
||||
ExpireSessionUsageTimeout int `help:"Expire Session usage timeout second" default:"60"`
|
||||
|
||||
// completed queue options
|
||||
CompletedQueueConsumptionPeriod string `help:"Completed queue consumption period" default:"30s"`
|
||||
CompletedQueueConsumptionTimeout string `help:"Completed queue consumption timeout" default:"30s"`
|
||||
|
||||
Reference in New Issue
Block a user