mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-22 07:48:10 +03:00
cleanup
This commit is contained in:
parent
30e8c8b4a4
commit
92971e2e7a
@ -192,19 +192,19 @@ pull httpClient unisonShareUrl conn repoPath = do
|
|||||||
Right Nothing -> pure (Right Nothing)
|
Right Nothing -> pure (Right Nothing)
|
||||||
Right (Just hashJwt) -> do
|
Right (Just hashJwt) -> do
|
||||||
let hash = Share.hashJWTHash hashJwt
|
let hash = Share.hashJWTHash hashJwt
|
||||||
let success = pure (Right (Just (CausalHash (Hash.fromBase32Hex (Share.toBase32Hex hash)))))
|
|
||||||
runDB (entityLocation2 hash) >>= \case
|
runDB (entityLocation2 hash) >>= \case
|
||||||
EntityInMainStorage2 -> success
|
EntityInMainStorage2 -> pure ()
|
||||||
EntityInTempStorage2 missingDependencies -> do
|
EntityInTempStorage2 missingDependencies -> doDownload missingDependencies
|
||||||
download httpClient unisonShareUrl conn (Share.RepoPath.repoName repoPath) missingDependencies
|
EntityNotStored2 -> doDownload (NESet.singleton hashJwt)
|
||||||
success
|
pure (Right (Just (CausalHash (Hash.fromBase32Hex (Share.toBase32Hex hash)))))
|
||||||
EntityNotStored2 -> do
|
|
||||||
download httpClient unisonShareUrl conn (Share.RepoPath.repoName repoPath) (NESet.singleton hashJwt)
|
|
||||||
success
|
|
||||||
where
|
where
|
||||||
runDB :: ReaderT Connection IO a -> IO a
|
runDB :: ReaderT Connection IO a -> IO a
|
||||||
runDB action = runReaderT action conn
|
runDB action = runReaderT action conn
|
||||||
|
|
||||||
|
doDownload :: NESet Share.HashJWT -> IO ()
|
||||||
|
doDownload =
|
||||||
|
download httpClient unisonShareUrl conn (Share.RepoPath.repoName repoPath)
|
||||||
|
|
||||||
-- Download a set of entities from Unison Share.
|
-- Download a set of entities from Unison Share.
|
||||||
download ::
|
download ::
|
||||||
AuthorizedHttpClient ->
|
AuthorizedHttpClient ->
|
||||||
|
Loading…
Reference in New Issue
Block a user