p2phttp drop supports checking proof timestamps
At this point the p2phttp implementation is fully complete!
This commit is contained in:
parent
6a3f755bfa
commit
b13c2407af
4 changed files with 82 additions and 35 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue