parent
3482876d9b
commit
0494ddd696
4 changed files with 12 additions and 5 deletions
|
@ -181,11 +181,16 @@ cacheWriter nsSTM =
|
|||
modifyTVar' (nodeCacheSTM ns) cacheModifier
|
||||
|
||||
stabiliseThread :: LocalNodeStateSTM -> IO ()
|
||||
stabiliseThread nsSTM = do
|
||||
stabiliseThread nsSTM = forever $ do
|
||||
ns <- readTVarIO nsSTM
|
||||
-- TODO: update successfully stabilised nodes in cache
|
||||
-- placeholder
|
||||
stabiliseNeighbour nsSTM successors 1
|
||||
pure ()
|
||||
-- first stabilise immediate neihbours, then the next ones
|
||||
forM_ [1..(kNeighbours ns)] (\num -> do
|
||||
stabiliseNeighbour nsSTM predecessors num
|
||||
stabiliseNeighbour nsSTM successors num
|
||||
)
|
||||
-- TODO: make delay configurable
|
||||
threadDelay (60 * 1000)
|
||||
where
|
||||
stabiliseNeighbour :: LocalNodeStateSTM
|
||||
-> (LocalNodeState -> [RemoteNodeState])
|
||||
|
|
|
@ -613,6 +613,7 @@ data FediChordConf = FediChordConf
|
|||
, confIP :: HostAddress6
|
||||
, confDhtPort :: Int
|
||||
, confBootstrapNodes :: [(String, PortNumber)]
|
||||
--, confStabiliseInterval :: Int
|
||||
}
|
||||
deriving (Show, Eq)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue