From 9497207115ed51663415c9e066a86bcb615a3cf8 Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Fri, 15 Mar 2024 12:01:50 +0300 Subject: [PATCH] debug --- hbs2-peer/app/RPC2/LWWRef.hs | 3 ++- .../hbs2-git-client-lib/HBS2/Git/Client/Import.hs | 4 +++- .../hbs2-git-client-lib/HBS2/Git/Client/RefLog.hs | 2 +- nix/peer/flake.lock | 13 ++++++------- nix/peer/flake.nix | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/hbs2-peer/app/RPC2/LWWRef.hs b/hbs2-peer/app/RPC2/LWWRef.hs index 2292aac1..3c607605 100644 --- a/hbs2-peer/app/RPC2/LWWRef.hs +++ b/hbs2-peer/app/RPC2/LWWRef.hs @@ -12,6 +12,7 @@ import HBS2.Peer.Proto.LWWRef import HBS2.Peer.Proto.LWWRef.Internal import HBS2.Storage import HBS2.Net.Messaging.Unix +import HBS2.Misc.PrettyStuff import PeerTypes @@ -49,7 +50,7 @@ instance LWWRefContext m => HandleMethod m RpcLWWRefFetch where handleMethod key = do co <- getRpcContext @LWWRefAPI - debug $ "rpc.LWWRefFetch" <+> pretty key + debug $ green "rpc.LWWRefFetch" <+> pretty key let penv = rpcPeerEnv co liftIO $ withPeerM penv $ do diff --git a/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/Import.hs b/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/Import.hs index f995c8c8..bc27a181 100644 --- a/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/Import.hs +++ b/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/Import.hs @@ -85,7 +85,9 @@ importRepoWait lwwKey = do IWaitLWWBlock w -> do onProgress ip (ImportWaitLWW w lwwKey) - lww <- readLWWBlock @L4Proto sto lwwKey + debug $ yellow ("fetchLWWRef" <+> pretty lwwKey) + fetchLWWRef lwwKey + lww <- readLWWBlock sto lwwKey case lww of Nothing -> do diff --git a/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/RefLog.hs b/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/RefLog.hs index 3eddc93e..a44de8c6 100644 --- a/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/RefLog.hs +++ b/hbs21-git/hbs2-git-client-lib/HBS2/Git/Client/RefLog.hs @@ -29,7 +29,7 @@ subscribeLWWRef puk = do fetchLWWRef :: (GitPerks m, MonadReader GitEnv m) => LWWRefKey HBS2Basic -> m () fetchLWWRef key = do api <- asks _lwwRefAPI - void $ race (pause @'Seconds 1) (callService @RpcLWWRefFetch api key) + void $ race (pause @'Seconds 2) (callService @RpcLWWRefFetch api key) getRefLogMerkle :: (GitPerks m, MonadReader GitEnv m) => RefLogId -> m (Maybe HashRef) diff --git a/nix/peer/flake.lock b/nix/peer/flake.lock index 1607319a..0c119169 100644 --- a/nix/peer/flake.lock +++ b/nix/peer/flake.lock @@ -295,17 +295,16 @@ "suckless-conf": "suckless-conf_2" }, "locked": { - "lastModified": 1709273510, - "narHash": "sha256-wyerw00pnZq64wQGg+azHnLWzDz4C7PvBqCK3U5ejRI=", - "ref": "totally-new-download", - "rev": "a6e955aa611c3f9485976ce7eba33570a43f2eb7", - "revCount": 1036, + "lastModified": 1710431896, + "narHash": "sha256-yQ52vtX92Ys4xqsPDCIqOrR5HBVE+rJ+VagaHc9017c=", + "ref": "lwwrepo", + "rev": "3cd16684515a93bbf985891ed8e9913382484fbf", + "revCount": 981, "type": "git", "url": "http://git.hbs2/BTThPdHKF8XnEq4m6wzbKHKA6geLFK4ydYhBXAqBdHSP" }, "original": { - "ref": "totally-new-download", - "rev": "a6e955aa611c3f9485976ce7eba33570a43f2eb7", + "ref": "lwwrepo", "type": "git", "url": "http://git.hbs2/BTThPdHKF8XnEq4m6wzbKHKA6geLFK4ydYhBXAqBdHSP" } diff --git a/nix/peer/flake.nix b/nix/peer/flake.nix index b8f1e540..c320d6f8 100644 --- a/nix/peer/flake.nix +++ b/nix/peer/flake.nix @@ -7,7 +7,7 @@ extra-container.url = "github:erikarvstedt/extra-container"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; hbs2.url = - "git+http://git.hbs2/BTThPdHKF8XnEq4m6wzbKHKA6geLFK4ydYhBXAqBdHSP?ref=totally-new-download&rev=a6e955aa611c3f9485976ce7eba33570a43f2eb7"; + "git+http://git.hbs2/BTThPdHKF8XnEq4m6wzbKHKA6geLFK4ydYhBXAqBdHSP?ref=lwwrepo"; hbs2.inputs.nixpkgs.follows = "nixpkgs"; home-manager.url = "github:nix-community/home-manager";