()
| 293 | } |
| 294 | |
| 295 | func (cnf *Configuration) setDefaultValues() { |
| 296 | // Project defaults |
| 297 | if cnf.ProjectName == "" { |
| 298 | cnf.ProjectName = "LedgerForge Server" |
| 299 | logrus.Warn("project name is empty, setting default name") |
| 300 | } |
| 301 | |
| 302 | // Server defaults |
| 303 | if cnf.Server.Port == "" { |
| 304 | cnf.Server.Port = DEFAULT_PORT |
| 305 | logrus.WithField("port", DEFAULT_PORT).Warn("port not specified in config, setting default") |
| 306 | } |
| 307 | |
| 308 | if cnf.TypeSenseKey == "" { |
| 309 | cnf.TypeSenseKey = DEFAULT_TYPESENSE_KEY |
| 310 | } |
| 311 | |
| 312 | // Set module defaults |
| 313 | cnf.setRedisDefaults() |
| 314 | cnf.setDatabaseDefaults() |
| 315 | cnf.setTransactionDefaults() |
| 316 | cnf.setReconciliationDefaults() |
| 317 | cnf.setQueueDefaults() |
| 318 | |
| 319 | if cnf.EnableTelemetry { |
| 320 | logrus.Info("telemetry enabled") |
| 321 | } else { |
| 322 | logrus.Info("telemetry disabled") |
| 323 | } |
| 324 | |
| 325 | if cnf.EnableObservability { |
| 326 | logrus.Info("observability enabled") |
| 327 | } else { |
| 328 | logrus.Info("observability disabled") |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | func (cnf *Configuration) setTransactionDefaults() { |
| 333 | if cnf.Transaction.BatchSize == 0 { |
no test coverage detected