webapp: Avoid an error if a transfer is stopped just as it finishes. Closes: #698184

This commit is contained in:
Joey Hess 2013-01-14 18:58:45 -04:00
parent 7efdab3852
commit a707d69e77
2 changed files with 3 additions and 1 deletions

View file

@ -88,7 +88,7 @@ cancelTransfer pause t = do
| otherwise = killThread tid
{- In order to stop helper processes like rsync,
- kill the whole process group of the process running the transfer. -}
killproc pid = do
killproc pid = void $ catchMaybeIO $ do
g <- getProcessGroupIDOf pid
void $ tryIO $ signalProcessGroup sigTERM g
threadDelay 50000 -- 0.05 second grace period