MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / setQueueDefaults

Method setQueueDefaults

config/config.go:375–417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

373}
374
375func (cnf *Configuration) setQueueDefaults() {
376 if cnf.Queue.TransactionQueue == "" {
377 cnf.Queue.TransactionQueue = defaultQueue.TransactionQueue
378 }
379 if cnf.Queue.WebhookQueue == "" {
380 cnf.Queue.WebhookQueue = defaultQueue.WebhookQueue
381 }
382 if cnf.Queue.IndexQueue == "" {
383 cnf.Queue.IndexQueue = defaultQueue.IndexQueue
384 }
385 if cnf.Queue.InflightExpiryQueue == "" {
386 cnf.Queue.InflightExpiryQueue = defaultQueue.InflightExpiryQueue
387 }
388 if cnf.Queue.NumberOfQueues == 0 {
389 cnf.Queue.NumberOfQueues = defaultQueue.NumberOfQueues
390 }
391 if cnf.Queue.HotQueueName == "" {
392 cnf.Queue.HotQueueName = defaultQueue.HotQueueName
393 }
394 if cnf.Queue.HotQueueConcurrency == 0 {
395 cnf.Queue.HotQueueConcurrency = defaultQueue.HotQueueConcurrency
396 }
397 if cnf.Queue.HotPairTTL == 0 {
398 cnf.Queue.HotPairTTL = defaultQueue.HotPairTTL
399 } else {
400 cnf.Queue.HotPairTTL = cnf.Queue.HotPairTTL * time.Second
401 }
402 if cnf.Queue.HotPairLockContentionThreshold == 0 {
403 cnf.Queue.HotPairLockContentionThreshold = defaultQueue.HotPairLockContentionThreshold
404 }
405 if cnf.Queue.MaxRetryAttempts == 0 {
406 cnf.Queue.MaxRetryAttempts = defaultQueue.MaxRetryAttempts
407 }
408 if cnf.Queue.MonitoringPort == "" {
409 cnf.Queue.MonitoringPort = defaultQueue.MonitoringPort
410 }
411 if cnf.Queue.WebhookConcurrency == 0 {
412 cnf.Queue.WebhookConcurrency = defaultQueue.WebhookConcurrency
413 }
414 if cnf.Queue.TransactionWorkerConcurrency == 0 {
415 cnf.Queue.TransactionWorkerConcurrency = defaultQueue.TransactionWorkerConcurrency
416 }
417}
418
419func (cnf *Configuration) setRedisDefaults() {
420 if cnf.Redis.PoolSize == 0 {

Callers 1

setDefaultValuesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected