mirror of
https://github.com/JustKato/drive-health.git
synced 2026-04-30 01:42:29 +03:00
Started moving to a sqlite3 implementation
This commit is contained in:
@@ -9,10 +9,10 @@ import (
|
||||
)
|
||||
|
||||
type DHConfig struct {
|
||||
DiskFetchFrequency int `json:"diskFetchFrequency"`
|
||||
MemoryDumpFrequency int `json:"memoryDumpFrequency"`
|
||||
MaxHistoryAge int `json:"maxHistoryAge"`
|
||||
Listen string
|
||||
DiskFetchFrequency int `json:"diskFetchFrequency"`
|
||||
MaxHistoryAge int `json:"maxHistoryAge"`
|
||||
DatabaseFilePath string
|
||||
Listen string
|
||||
}
|
||||
|
||||
func GetConfiguration() DHConfig {
|
||||
@@ -22,9 +22,9 @@ func GetConfiguration() DHConfig {
|
||||
}
|
||||
|
||||
config := DHConfig{
|
||||
DiskFetchFrequency: 5, // default value
|
||||
MemoryDumpFrequency: 60, // default value
|
||||
MaxHistoryAge: 2592000, // default value
|
||||
DiskFetchFrequency: 5, // default value
|
||||
MaxHistoryAge: 2592000, // default value
|
||||
DatabaseFilePath: "./data.db",
|
||||
|
||||
Listen: ":8080",
|
||||
}
|
||||
@@ -35,12 +35,6 @@ func GetConfiguration() DHConfig {
|
||||
}
|
||||
}
|
||||
|
||||
if val, exists := os.LookupEnv("MEMORY_DUMP_FREQUENCY"); exists {
|
||||
if intValue, err := strconv.Atoi(val); err == nil {
|
||||
config.MemoryDumpFrequency = intValue
|
||||
}
|
||||
}
|
||||
|
||||
if val, exists := os.LookupEnv("MAX_HISTORY_AGE"); exists {
|
||||
if intValue, err := strconv.Atoi(val); err == nil {
|
||||
config.MaxHistoryAge = intValue
|
||||
@@ -51,5 +45,9 @@ func GetConfiguration() DHConfig {
|
||||
config.Listen = val
|
||||
}
|
||||
|
||||
if val, exists := os.LookupEnv("DATABASE_FILE_PATH"); exists {
|
||||
config.DatabaseFilePath = val
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user