* Custom listen

This commit is contained in:
2024-01-20 02:09:10 +02:00
parent 498aba835f
commit 21f24899a2
2 changed files with 9 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ type DHConfig struct {
DiskFetchFrequency int `json:"diskFetchFrequency"`
MemoryDumpFrequency int `json:"memoryDumpFrequency"`
MaxHistoryAge int `json:"maxHistoryAge"`
Listen string
}
func GetConfiguration() DHConfig {
@@ -24,6 +25,8 @@ func GetConfiguration() DHConfig {
DiskFetchFrequency: 5, // default value
MemoryDumpFrequency: 60, // default value
MaxHistoryAge: 2592000, // default value
Listen: ":8080",
}
if val, exists := os.LookupEnv("DISK_FETCH_FREQUENCY"); exists {
@@ -44,5 +47,9 @@ func GetConfiguration() DHConfig {
}
}
if val, exists := os.LookupEnv("LISTEN"); exists {
config.Listen = val
}
return config
}