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:
parent
e9db0a1162
commit
7d99c4b35c
|
@ -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
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Reference in New Issue