mirror of
https://github.com/axllent/mailpit.git
synced 2025-08-13 20:04:49 +02:00
Improve Prometheus GetMode detection
This commit is contained in:
@@ -178,11 +178,13 @@ func StartSeparateServer() {
|
|||||||
// GetMode returns the Prometheus run mode
|
// GetMode returns the Prometheus run mode
|
||||||
func GetMode() string {
|
func GetMode() string {
|
||||||
mode := strings.ToLower(strings.TrimSpace(config.PrometheusListen))
|
mode := strings.ToLower(strings.TrimSpace(config.PrometheusListen))
|
||||||
if mode == "false" {
|
|
||||||
|
switch {
|
||||||
|
case mode == "false", mode == "":
|
||||||
return "disabled"
|
return "disabled"
|
||||||
}
|
case mode == "true":
|
||||||
if mode == "true" {
|
|
||||||
return "integrated"
|
return "integrated"
|
||||||
|
default:
|
||||||
|
return "separate"
|
||||||
}
|
}
|
||||||
return "separate"
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user