summaryrefslogtreecommitdiff
path: root/Assistant/Threads/TransferWatcher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-19 16:59:18 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-19 16:59:18 -0400
commit08bcc91999c1883efaea376c2df984b11ad5d5e6 (patch)
tree3e12fc8d7483f1e6e8b8414561bb209db26eb6e1 /Assistant/Threads/TransferWatcher.hs
parent5237b17193befdac87dfbeac9391e5ccad3049bb (diff)
nasty race workaround
Diffstat (limited to 'Assistant/Threads/TransferWatcher.hs')
-rw-r--r--Assistant/Threads/TransferWatcher.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Assistant/Threads/TransferWatcher.hs b/Assistant/Threads/TransferWatcher.hs
index e82e4fb08..168ff2688 100644
--- a/Assistant/Threads/TransferWatcher.hs
+++ b/Assistant/Threads/TransferWatcher.hs
@@ -18,6 +18,8 @@ import Utility.DirWatcher
import Utility.Types.DirWatcher
import qualified Remote
+import Control.Concurrent
+
thisThread :: ThreadName
thisThread = "TransferWatcher"
@@ -103,7 +105,13 @@ onDel st dstatus transferqueue file _ = case parseTransferFile file of
, show t
]
minfo <- removeTransfer dstatus t
- finishedTransfer st dstatus transferqueue t minfo
+
+ void $ forkIO $ do
+ {- XXX race workaround delay. The location
+ - log needs to be updated before finishedTransfer
+ - runs. -}
+ threadDelay 10000000 -- 10 seconds
+ finishedTransfer st dstatus transferqueue t minfo
{- Queue uploads of files we successfully downloaded, spreading them
- out to other reachable remotes.