succd: remove redundant if

This commit is contained in:
zdmx 2024-09-28 11:20:25 +02:00
parent fbf41203de
commit f5d80a335f

View file

@ -104,11 +104,9 @@ func (d *daemon) processOnce(_ context.Context) error {
mbar := d.piraniMbar3.mbar mbar := d.piraniMbar3.mbar
if !d.safety.failsafe && mbar < 4e-6 { if !d.safety.failsafe && mbar < 4e-6 {
// Unrealistic result, Pirani probe probably disconnected. Failsafe mode. // Unrealistic result, Pirani probe probably disconnected. Failsafe mode.
if !d.safety.failsafe {
d.safety.failsafe = true d.safety.failsafe = true
klog.Errorf("SAFETY: Pirani probe seems disconnected; enabling failsafe mode") klog.Errorf("SAFETY: Pirani probe seems disconnected; enabling failsafe mode")
} }
}
if d.safety.failsafe && mbar > 1e2 { if d.safety.failsafe && mbar > 1e2 {
d.safety.failsafe = false d.safety.failsafe = false
klog.Infof("SAFETY: Pirani probe value (%s) is plausible again; quitting failsafe mode", formatMbar(mbar)) klog.Infof("SAFETY: Pirani probe value (%s) is plausible again; quitting failsafe mode", formatMbar(mbar))