From a240bc23f0f88e43ed2897e5b740bd7a1e51355a Mon Sep 17 00:00:00 2001 From: voidlizard Date: Wed, 22 Jan 2025 20:15:25 +0300 Subject: [PATCH] wip, bugfix --- hbs2-git3/lib/HBS2/Git3/Import.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hbs2-git3/lib/HBS2/Git3/Import.hs b/hbs2-git3/lib/HBS2/Git3/Import.hs index c78702dc..b90fa264 100644 --- a/hbs2-git3/lib/HBS2/Git3/Import.hs +++ b/hbs2-git3/lib/HBS2/Git3/Import.hs @@ -138,6 +138,7 @@ importGitRefLog = withStateDo $ ask >>= \case flip fix ImportStart $ \again -> \case ImportDone x -> do + notice "import done" for_ x updateImportedCheckpoint updateReflogIndex pure x @@ -151,11 +152,9 @@ importGitRefLog = withStateDo $ ask >>= \case notice $ "wait some time..." <+> parens (pretty down) case d of - Just n | down < n -> pause @'Seconds 3 >> again next - _ -> pure Nothing + Just n | down < n || down == 0 -> again next - pause @'Seconds 3 - again $ ImportWait (Just down) next + _ -> pause @'Seconds 3 >> again (ImportWait (Just down) next) ImportStart -> do @@ -225,8 +224,8 @@ importGitRefLog = withStateDo $ ask >>= \case case r of Right cp -> again $ ImportDone cp - Left (MissedBlockError2 _) -> again $ ImportWait Nothing (ImportWIP (succ attempt) prev) - Left MissedBlockError -> again $ ImportWait Nothing (ImportWIP (succ attempt) prev) + Left (MissedBlockError2 _) -> notice "missed blocks" >> again (ImportWait Nothing (ImportWIP (succ attempt) prev)) + Left MissedBlockError -> notice "missed blocks" >> again (ImportWait Nothing (ImportWIP (succ attempt) prev)) Left e -> throwIO e