diff --git a/hbs2-peer/app/PeerConfig.hs b/hbs2-peer/app/PeerConfig.hs index 2c0958a9..48c8bcb1 100644 --- a/hbs2-peer/app/PeerConfig.hs +++ b/hbs2-peer/app/PeerConfig.hs @@ -44,7 +44,7 @@ pattern Key n ns <- SymbolVal n : ns data PeerListenTCPKey data PeerDownloadLogKey data PeerHttpPortKey -data PeerTcpPropWaitKey +data PeerTcpProbeWaitKey data PeerUseHttpDownload instance HasCfgKey PeerListenTCPKey (Maybe String) where @@ -53,8 +53,8 @@ instance HasCfgKey PeerListenTCPKey (Maybe String) where instance HasCfgKey PeerHttpPortKey (Maybe Integer) where key = "http-port" -instance HasCfgKey PeerTcpPropWaitKey (Maybe Integer) where - key = "tcp-prop-wait" +instance HasCfgKey PeerTcpProbeWaitKey (Maybe Integer) where + key = "tcp-probe-wait" instance HasCfgKey PeerUseHttpDownload FeatureSwitch where key = "http-download" diff --git a/hbs2-peer/app/PeerMain.hs b/hbs2-peer/app/PeerMain.hs index 1036c8c5..8389829a 100644 --- a/hbs2-peer/app/PeerMain.hs +++ b/hbs2-peer/app/PeerMain.hs @@ -743,9 +743,10 @@ runPeer opts = Exception.handle myException $ do peerThread "blockDownloadLoop " (blockDownloadLoop denv) - let tcpPropWait :: Timeout 'Seconds - tcpPropWait = (fromInteger . fromMaybe 300) (cfgValue @PeerTcpPropWaitKey conf) - peerThread "fillPeerMeta" (fillPeerMeta tcp tcpPropWait) + let tcpProbeWait :: Timeout 'Seconds + tcpProbeWait = (fromInteger . fromMaybe 300) (cfgValue @PeerTcpProbeWaitKey conf) + + peerThread "fillPeerMeta" (fillPeerMeta tcp tcpProbeWait) -- FIXME: clumsy-code -- Is it better now ? diff --git a/hbs2-peer/app/PeerMeta.hs b/hbs2-peer/app/PeerMeta.hs index 10962521..ee3a1988 100644 --- a/hbs2-peer/app/PeerMeta.hs +++ b/hbs2-peer/app/PeerMeta.hs @@ -49,11 +49,11 @@ fillPeerMeta :: forall e m t . , IsTimeout t ) => Maybe MessagingTCP -> Timeout t -> m () -fillPeerMeta mtcp propPeriod = do +fillPeerMeta mtcp probePeriod = do debug "I'm fillPeerMeta" pl <- getPeerLocator @e - forever $ (>> (pause propPeriod)) $ do + forever $ (>> pause probePeriod) $ do pause @'Seconds 5 -- wait 'till everything calm down ps <- knownPeers @e pl