summaryrefslogtreecommitdiff
path: root/Assistant/Threads/TransferWatcher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-10 15:45:00 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-10 15:52:22 -0400
commita76078a78e4dc353e7b4e99a250ddd3d83f74ba3 (patch)
tree09624c51c139facc4681cb4a9cb3271097b0990e /Assistant/Threads/TransferWatcher.hs
parentd5e06e7b89133d8178b604724a41d4a392d577cd (diff)
process group killing
This seems to work pretty well. Handled the process groups like this: - git-annex processes started by the assistant for transfers are run in their own process groups. - otherwise, rely on the shell to allocate a process group for git-annex There is potentially a problem if some other program runs git-annex directly (not using sh -c) The program and git-annex would then be in the same process group. If that git-annex starts a transfer and it's canceled, the program would also get killed. May or may not be a desired result. Also, the new updateTransferInfo probably closes a race where it was possible for the thread id to not be recorded in the transfer info, if the transfer info file from the transfer process is read first.
Diffstat (limited to 'Assistant/Threads/TransferWatcher.hs')
-rw-r--r--Assistant/Threads/TransferWatcher.hs7
1 files changed, 1 insertions, 6 deletions
diff --git a/Assistant/Threads/TransferWatcher.hs b/Assistant/Threads/TransferWatcher.hs
index 447ff2264..66c916990 100644
--- a/Assistant/Threads/TransferWatcher.hs
+++ b/Assistant/Threads/TransferWatcher.hs
@@ -14,8 +14,6 @@ import Logs.Transfer
import Utility.DirWatcher
import Utility.Types.DirWatcher
-import Data.Map as M
-
thisThread :: ThreadName
thisThread = "TransferWatcher"
@@ -63,10 +61,7 @@ onAdd st dstatus file _ = case parseTransferFile file of
[ "transfer starting:"
, show t
]
- adjustTransfers dstatus $
- M.insertWith' merge t info
- -- preseve transferTid, which is not written to disk
- merge new old = new { transferTid = transferTid old }
+ updateTransferInfo dstatus t info
{- Called when a transfer information file is removed. -}
onDel :: Handler