mirror of
https://github.com/JustKato/drive-health.git
synced 2026-02-27 06:17:00 +02:00
* Custom listen
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user