fix agent phase, test (#427)

This commit is contained in:
Evgeny Poberezkin authored and GitHub committed 2022-06-25 08:13:07 +01:00
1 parent 9e0e6b1afc
commit c2f1dabcd0
3 files changed
+40 -11

No files matched your search

+1 -1
View File
@@ -644,7 +644,7 @@ cryptoError = \case
endAgentOperation :: AgentClient -> AgentOperation -> STM ()
endAgentOperation c@AgentClient {agentEnv = Env {agentOperations}} op = do
TM.alter (Just . maybe 0 (\n -> min 0 $ n - 1)) op agentOperations
TM.alter (Just . maybe 0 (\n -> max 0 $ n - 1)) op agentOperations
notifyAgentPhaseChanged c
beginAgentOperation :: AgentClient -> AgentOperation -> STM ()
+1 -1
View File
@@ -127,7 +127,7 @@ data Env = Env
}
data AgentOperation = AONetwork | AODatabase
deriving (Eq, Ord)
deriving (Eq, Ord, Show)
disallowedOperations :: AgentPhase -> [AgentOperation]
disallowedOperations = \case