feat: webhooker 1.0 MVP — entity rename, core engine, delivery, management UI #16
@@ -2,7 +2,6 @@ package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -135,7 +134,11 @@ func (m *Manager) Get(key string, defaultValue interface{}) interface{} {
|
||||
// Double-check after acquiring write lock
|
||||
if m.config == nil || len(m.config) == 0 {
|
||||
if err := m.loadConfig(); err != nil {
|
||||
log.Printf("Failed to load config: %v", err)
|
||||
// Config file not found is expected when all values
|
||||
// come from environment variables. Only log at debug
|
||||
// level to avoid confusing "Failed to load config"
|
||||
// messages during normal operation.
|
||||
_ = err
|
||||
m.mu.Unlock()
|
||||
return defaultValue
|
||||
}
|
||||
@@ -206,7 +209,9 @@ func (m *Manager) GetSecret(key string, defaultValue interface{}) interface{} {
|
||||
// Double-check after acquiring write lock
|
||||
if m.config == nil || len(m.config) == 0 {
|
||||
if err := m.loadConfig(); err != nil {
|
||||
log.Printf("Failed to load config: %v", err)
|
||||
// Config file not found is expected when all values
|
||||
// come from environment variables.
|
||||
_ = err
|
||||
m.mu.Unlock()
|
||||
return defaultValue
|
||||
}
|
||||
@@ -218,7 +223,6 @@ func (m *Manager) GetSecret(key string, defaultValue interface{}) interface{} {
|
||||
defer m.mu.RUnlock()
|
||||
|
||||
if m.environment == "" {
|
||||
log.Printf("No environment set when getting secret '%s'", key)
|
||||
return defaultValue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user