better handling of finishing up incomplete incremental verify
Now it's run in VerifyStage. I thought about keeping the file handle open, and resuming reading where tailVerify left off. But that risks leaking open file handles, until the GC closes them, if the deferred verification does not get resumed. Since that could perhaps happen if there's an exception somewhere, I decided that was too unsafe. Instead, re-open the file, seek, and resume. Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
e0b7f391bd
commit
c4aba8e032
7 changed files with 114 additions and 88 deletions
|
@ -2,7 +2,7 @@
|
|||
-
|
||||
- Most things should not need this, using Types instead
|
||||
-
|
||||
- Copyright 2011-2020 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2011-2021 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
@ -41,6 +41,7 @@ import Types.NumCopies
|
|||
import Types.Export
|
||||
import Types.Import
|
||||
import Types.RemoteConfig
|
||||
import Types.Backend (IncrementalVerifier)
|
||||
import Config.Cost
|
||||
import Utility.Metered
|
||||
import Git.Types (RemoteName)
|
||||
|
@ -203,7 +204,9 @@ data Verification
|
|||
| MustVerify
|
||||
-- ^ Content likely to have been altered during transfer,
|
||||
-- verify even if verification is normally disabled
|
||||
deriving (Show)
|
||||
| IncompleteVerify IncrementalVerifier
|
||||
-- ^ Content was partially verified during transfer, but
|
||||
-- the verification is not complete.
|
||||
|
||||
unVerified :: Monad m => m a -> m (a, Verification)
|
||||
unVerified a = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue