mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Concurrent requests configured also via shared variable
This commit is contained in:
@@ -450,7 +450,15 @@ func main() {
|
||||
}
|
||||
utils.Logger.SetLogLevel(lgLevel)
|
||||
// init the concurrentRequests
|
||||
utils.ConReqs = utils.NewConReqs(cfg.GeneralCfg().ConcurrentRequests, cfg.GeneralCfg().ConcurrentStrategy)
|
||||
cncReqsLimit := cfg.GeneralCfg().ConcurrentRequests
|
||||
if utils.ConcurrentReqsLimit != 0 { // used as shared variable
|
||||
cncReqsLimit = utils.ConcurrentReqsLimit
|
||||
}
|
||||
cncReqsStrategy := cfg.GeneralCfg().ConcurrentStrategy
|
||||
if utils.ConcurrentReqsStrategy != "" {
|
||||
cncReqsStrategy = utils.ConcurrentReqsStrategy
|
||||
}
|
||||
utils.ConReqs = utils.NewConReqs(cncReqsLimit, cncReqsStrategy)
|
||||
utils.Logger.Info(fmt.Sprintf("<CoreS> starting version <%s><%s>", vers, goVers))
|
||||
cfg.LazySanityCheck()
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ func NewConReqs(reqs int, strategy string) *ConcReqs {
|
||||
|
||||
// IsLimited returns true if the limit is not 0
|
||||
func (cR *ConcReqs) IsLimited() bool {
|
||||
return ConReqs.limit != 0
|
||||
return cR.limit != 0
|
||||
}
|
||||
|
||||
// Allocate will reserve a channel for the API call
|
||||
|
||||
@@ -871,6 +871,8 @@ const (
|
||||
ProcessRuns = "ProcessRuns"
|
||||
HashtagSep = "#"
|
||||
MetaRounding = "*rounding"
|
||||
ConcurrentReqsLimit = 0
|
||||
ConcurrentReqsStrategy = ""
|
||||
)
|
||||
|
||||
// Migrator Action
|
||||
|
||||
Reference in New Issue
Block a user