refactor: hlint

This commit is contained in:
Gregor Kleen 2020-07-17 16:52:34 +02:00
parent cadb18df7b
commit fc49f46f50
2 changed files with 3 additions and 6 deletions

View File

@ -11,6 +11,7 @@
- ignore: { name: "Use ++" } - ignore: { name: "Use ++" }
- ignore: { name: "Use ***" } - ignore: { name: "Use ***" }
- ignore: { name: "Redundant void" } - ignore: { name: "Redundant void" }
- ignore: { name: "Too strict maybe" }
- arguments: - arguments:
- -XQuasiQuotes - -XQuasiQuotes

View File

@ -150,9 +150,7 @@ withFailover' testTarget' f@Failover{..} mode detAcceptable act = withFailoverRe
$logErrorS "withFailover'" $ tshow (hashUnique alreadyTested) <> " recording failure for item " <> failoverLabel $logErrorS "withFailover'" $ tshow (hashUnique alreadyTested) <> " recording failure for item " <> failoverLabel
atomically . modifyTVar failover $ \failover' -> if atomically . modifyTVar failover $ \failover' -> if
| views (P.focus . _failoverReferences) (Set.member currentlyTesting) failover' | views (P.focus . _failoverReferences) (Set.member currentlyTesting) failover'
-> case P.next failover' of -> fromMaybe failover' $ P.next failover'
Just failover'' -> failover''
Nothing -> failover'
| otherwise | otherwise
-> failover' -> failover'
@ -212,7 +210,7 @@ failoverMetrics fLbl failoverMetricsFailover@Failover{..} = Metric $ do
now <- liftIO $ getTime Monotonic now <- liftIO $ getTime Monotonic
cTime <- liftIO getPOSIXTime cTime <- liftIO getPOSIXTime
metrics <- atomically $ do atomically $ do
foState <- readTVar failover foState <- readTVar failover
labelsSeen' <- stateTVar labelsSeen $ \labelsSeen' -> labelsSeen' labelsSeen' <- stateTVar labelsSeen $ \labelsSeen' -> labelsSeen'
& ala Endo foldMap [ Map.insert failoverLabel failoverLastTest | FailoverItem{..} <- F.toList foState ] & ala Endo foldMap [ Map.insert failoverLabel failoverLastTest | FailoverItem{..} <- F.toList foState ]
@ -228,8 +226,6 @@ failoverMetrics fLbl failoverMetricsFailover@Failover{..} = Metric $ do
] ]
] ]
return metrics
failoverActiveInfo = Info "uni2work_failover_active_bool" failoverActiveInfo = Info "uni2work_failover_active_bool"
"Currently active item in the failover set" "Currently active item in the failover set"
failoverLastTestInfo = Info "uni2work_failover_last_test_time" failoverLastTestInfo = Info "uni2work_failover_last_test_time"