reconnect agent clients on any network config change (#489)

* reconnect agent clients on any network config change

* add Eq instances
This commit is contained in:
Evgeny Poberezkin 2022-08-03 09:59:49 +01:00 committed by GitHub
parent e9db0a1162
commit 7d99c4b35c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -213,7 +213,7 @@ setNetworkConfig :: AgentErrorMonad m => AgentClient -> NetworkConfig -> m ()
setNetworkConfig c cfg' = do
cfg <- atomically $ do
swapTVar (useNetworkConfig c) cfg'
liftIO . when (socksProxy cfg /= socksProxy cfg') $ do
liftIO . when (cfg /= cfg') $ do
closeProtocolServerClients c smpClients
closeProtocolServerClients c ntfClients

View File

@ -127,7 +127,7 @@ data NetworkConfig = NetworkConfig
-- | period for SMP ping commands (microseconds)
smpPingInterval :: Int
}
deriving (Show, Generic, FromJSON)
deriving (Eq, Show, Generic, FromJSON)
instance ToJSON NetworkConfig where
toJSON = J.genericToJSON J.defaultOptions {J.omitNothingFields = True}

View File

@ -17,7 +17,7 @@ data KeepAliveOpts = KeepAliveOpts
keepIntvl :: Int,
keepCnt :: Int
}
deriving (Show, Generic, FromJSON)
deriving (Eq, Show, Generic, FromJSON)
instance ToJSON KeepAliveOpts where toEncoding = J.genericToEncoding J.defaultOptions