From 73c28d2ca7c6c910a5448f34f9d415607fbfdde9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Oct 2012 16:59:18 -0400 Subject: [PATCH] nasty race workaround --- Assistant/Threads/TransferWatcher.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assistant/Threads/TransferWatcher.hs b/Assistant/Threads/TransferWatcher.hs index e82e4fb084..168ff26885 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.