mirror of https://github.com/voidlizard/hbs2
wip, bugfix
This commit is contained in:
parent
873cfbeacd
commit
a240bc23f0
|
@ -138,6 +138,7 @@ importGitRefLog = withStateDo $ ask >>= \case
|
||||||
|
|
||||||
flip fix ImportStart $ \again -> \case
|
flip fix ImportStart $ \again -> \case
|
||||||
ImportDone x -> do
|
ImportDone x -> do
|
||||||
|
notice "import done"
|
||||||
for_ x updateImportedCheckpoint
|
for_ x updateImportedCheckpoint
|
||||||
updateReflogIndex
|
updateReflogIndex
|
||||||
pure x
|
pure x
|
||||||
|
@ -151,11 +152,9 @@ importGitRefLog = withStateDo $ ask >>= \case
|
||||||
notice $ "wait some time..." <+> parens (pretty down)
|
notice $ "wait some time..." <+> parens (pretty down)
|
||||||
|
|
||||||
case d of
|
case d of
|
||||||
Just n | down < n -> pause @'Seconds 3 >> again next
|
Just n | down < n || down == 0 -> again next
|
||||||
_ -> pure Nothing
|
|
||||||
|
|
||||||
pause @'Seconds 3
|
_ -> pause @'Seconds 3 >> again (ImportWait (Just down) next)
|
||||||
again $ ImportWait (Just down) next
|
|
||||||
|
|
||||||
ImportStart -> do
|
ImportStart -> do
|
||||||
|
|
||||||
|
@ -225,8 +224,8 @@ importGitRefLog = withStateDo $ ask >>= \case
|
||||||
|
|
||||||
case r of
|
case r of
|
||||||
Right cp -> again $ ImportDone cp
|
Right cp -> again $ ImportDone cp
|
||||||
Left (MissedBlockError2 _) -> again $ ImportWait Nothing (ImportWIP (succ attempt) prev)
|
Left (MissedBlockError2 _) -> notice "missed blocks" >> again (ImportWait Nothing (ImportWIP (succ attempt) prev))
|
||||||
Left MissedBlockError -> again $ ImportWait Nothing (ImportWIP (succ attempt) prev)
|
Left MissedBlockError -> notice "missed blocks" >> again (ImportWait Nothing (ImportWIP (succ attempt) prev))
|
||||||
Left e -> throwIO e
|
Left e -> throwIO e
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue