, preferredcontentmap :: Maybe (FileMatcherMap Annex)
, requiredcontentmap :: Maybe (FileMatcherMap Annex)
, remoteconfigmap :: Maybe (M.Map UUID RemoteConfig)
- , clusters :: Maybe Clusters
+ , clusters :: Maybe (Annex Clusters)
, forcetrust :: TrustMap
, trustmap :: Maybe TrustMap
, groupmap :: Maybe GroupMap
-}
startupAnnex :: Annex ()
startupAnnex = doQuietAction $
- -- Logs.Location needs clusters to be loaded before it is used,
- -- in order for a cluster to be treated as the location of keys
+ -- Logs.Location needs this before it is used, in order for a
+ -- cluster to be treated as the location of keys
-- that are located in any of its nodes.
- void loadClusters
+ preLoadClusters
startupSignals :: Annex ()
startupSignals = do
+git-annex (10.20240732) UNRELEASED; urgency=medium
+
+ * Avoid loading cluster log at startup.
+
+ -- Joey Hess <id@joeyh.name> Wed, 31 Jul 2024 15:52:03 -0400
+
git-annex (10.20240731) upstream; urgency=medium
* New HTTP API that is equivilant to the P2P protocol.
module Types.Cluster,
getClusters,
loadClusters,
+ preLoadClusters,
recordCluster,
) where
import qualified Data.Set as S
getClusters :: Annex Clusters
-getClusters = maybe loadClusters return =<< Annex.getState Annex.clusters
+getClusters = maybe loadClusters id =<< Annex.getState Annex.clusters
+
+{- This works around a module dependency loop. -}
+preLoadClusters :: Annex ()
+preLoadClusters = Annex.changeState $ \s ->
+ s { Annex.clusters = Just loadClusters }
{- Loads the clusters and caches it for later.
-
dead <- (S.fromList . map ClusterNodeUUID)
<$> trustGet DeadTrusted
clusters <- getClustersWith (M.map (`S.difference` dead))
- Annex.changeState $ \s -> s { Annex.clusters = Just clusters }
+ Annex.changeState $ \s -> s { Annex.clusters = Just (pure clusters) }
return clusters
-- Cannot import Logs.Cluster due to a cycle.
-- Annex.clusters gets populated when starting up git-annex.
getClusters :: Annex Clusters
-getClusters = fromMaybe noClusters <$> Annex.getState Annex.clusters
+getClusters = maybe (pure noClusters) id =<< Annex.getState Annex.clusters
[[!meta author=yoh]]
[[!tag projects/repronim]]
+
+> [[fixed|done]] --[[Joey]]
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2024-07-31T19:50:38Z"
+ content="""
+Aha! I found a way around the dependency loop.
+
+This is fixed.
+"""]]