p2phttp drop supports checking proof timestamps

At this point the p2phttp implementation is fully complete!
This commit is contained in:
Joey Hess 2024-07-25 10:11:09 -04:00
parent 6a3f755bfa
commit b13c2407af
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 82 additions and 35 deletions

View file

@ -479,12 +479,13 @@ dropKey r st proof key = do
dropKey' :: Git.Repo -> Remote -> State -> Maybe SafeDropProof -> Key -> Annex ()
dropKey' repo r st@(State connpool duc _ _ _) proof key
| isP2PHttp r = p2pHttpClient r giveup (clientRemove proof key) >>= \case
RemoveResultPlus True fanoutuuids ->
storefanout fanoutuuids
RemoveResultPlus False fanoutuuids -> do
storefanout fanoutuuids
giveup "removing content from remote failed"
| isP2PHttp r =
clientRemoveWithProof proof key unabletoremove r >>= \case
RemoveResultPlus True fanoutuuids ->
storefanout fanoutuuids
RemoveResultPlus False fanoutuuids -> do
storefanout fanoutuuids
unabletoremove
| not $ Git.repoIsUrl repo = ifM duc
( guardUsable repo (giveup "cannot access remote") removelocal
, giveup "remote does not have expected annex.uuid value"
@ -494,6 +495,8 @@ dropKey' repo r st@(State connpool duc _ _ _) proof key
where
p2prunner = Ssh.runProto r connpool (return (Right False, Nothing))
unabletoremove = giveup "removing content from remote failed"
-- It could take a long time to eg, automount a drive containing
-- the repo, so check the proof for expiry again after locking the
-- content for removal.