From 695f271cf87d74f692e53ccf5cef47654fb10602 Mon Sep 17 00:00:00 2001 From: voidlizard Date: Thu, 13 Feb 2025 15:26:11 +0300 Subject: [PATCH] git: latest checkpoint output --- hbs2-git3/app/GitRemoteHelper.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hbs2-git3/app/GitRemoteHelper.hs b/hbs2-git3/app/GitRemoteHelper.hs index 23632714..5acdcc0f 100644 --- a/hbs2-git3/app/GitRemoteHelper.hs +++ b/hbs2-git3/app/GitRemoteHelper.hs @@ -182,7 +182,10 @@ main = flip runContT pure do case what of [ListVal [SymbolVal "checkpoint", TextLike w, LitIntVal r]] -> do - atomically $ writeTVar cp_ (Just (w,r)) + atomically do + ts0 <- readTVar cp_ <&> fmap snd + when (Just r > ts0) do + writeTVar cp_ (Just (w,r)) [ListVal [SymbolVal "status", TextLike "FLUSH"]] -> do finished ()