Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

refactor: Remove unreachable dead code branches

rcourtman158669296ea3
diff --git a/internal/api/router.go b/internal/api/router.go
index 9278a85bf8..eddaf5ec72 100644
--- a/internal/api/router.go
+++ b/internal/api/router.go
@@ -1645,9 +1645,6 @@ func firstForwardedValue(header string) string {
return ""
}
parts := strings.Split(header, ",")
- if len(parts) == 0 {
- return ""
- }
return strings.TrimSpace(parts[0])
}
diff --git a/internal/api/security_tokens.go b/internal/api/security_tokens.go
index fb8875a981..1d4009d37a 100644
--- a/internal/api/security_tokens.go
+++ b/internal/api/security_tokens.go
@@ -76,10 +76,6 @@ func normalizeRequestedScopes(raw *[]string) ([]string, error) {
return []string{config.ScopeWildcard}, nil
}
- if len(normalized) == 0 {
- return nil, fmt.Errorf("select at least one scope")
- }
-
sort.Strings(normalized)
return normalized, nil
}
diff --git a/internal/monitoring/container_parsing.go b/internal/monitoring/container_parsing.go
index 2e35b7b691..82d15a1578 100644
--- a/internal/monitoring/container_parsing.go
+++ b/internal/monitoring/container_parsing.go
@@ -111,11 +111,7 @@ func convertContainerDiskInfo(status *proxmox.Container, metadata map[string]con
if mountpoint == "" {
mountpoint = label
}
- if lowerLabel != "" {
- disk.Type = lowerLabel
- } else {
- disk.Type = "disk"
- }
+ disk.Type = lowerLabel
}
disk.Mountpoint = mountpoint
diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.go
index e02579bfa7..22accaa6d6 100644
--- a/internal/monitoring/monitor.go
+++ b/internal/monitoring/monitor.go
@@ -862,9 +862,6 @@ func (m *Monitor) shouldRunBackupPoll(last time.Time, now time.Time) (bool, stri
}
remaining := int64(backupCycles) - (m.pollCounter % int64(backupCycles))
- if remaining <= 0 {
- remaining = int64(backupCycles)
- }
return false, fmt.Sprintf("next run in %d polling cycles", remaining), last
}
diff --git a/internal/monitoring/staleness_tracker.go b/internal/monitoring/staleness_tracker.go
index 326a06828c..50e0931c49 100644
--- a/internal/monitoring/staleness_tracker.go
+++ b/internal/monitoring/staleness_tracker.go
@@ -142,9 +142,6 @@ func (t *StalenessTracker) StalenessScore(instanceType InstanceType, instance st
if score > 1 {
score = 1
}
- if score < 0 {
- score = 0
- }
return score, true
}