diff options
-rw-r--r-- | Assistant/WebApp/DashBoard.hs | 15 | ||||
-rw-r--r-- | doc/design/assistant/syncing.mdwn | 3 |
2 files changed, 7 insertions, 11 deletions
diff --git a/Assistant/WebApp/DashBoard.hs b/Assistant/WebApp/DashBoard.hs index ffe967111..f9fad1bf6 100644 --- a/Assistant/WebApp/DashBoard.hs +++ b/Assistant/WebApp/DashBoard.hs @@ -209,16 +209,15 @@ cancelTransfer pause t = do startTransfer :: Transfer -> Handler () startTransfer t = do m <- getCurrentTransfers - webapp <- getYesod - let dstatus = daemonStatus webapp - let q = transferQueue webapp - {- resume a paused transfer -} - maybe noop go (M.lookup t m) - {- start a queued transfer -} - is <- liftIO $ map snd <$> getMatchingTransfers q dstatus (== t) - maybe noop start $ headMaybe is + maybe startqueued go (M.lookup t m) where go info = maybe (start info) (resume info) $ transferTid info + startqueued = do + webapp <- getYesod + let dstatus = daemonStatus webapp + let q = transferQueue webapp + is <- liftIO $ map snd <$> getMatchingTransfers q dstatus (== t) + maybe noop start $ headMaybe is resume info tid = do webapp <- getYesod let dstatus = daemonStatus webapp diff --git a/doc/design/assistant/syncing.mdwn b/doc/design/assistant/syncing.mdwn index d75e00da7..58b3257e3 100644 --- a/doc/design/assistant/syncing.mdwn +++ b/doc/design/assistant/syncing.mdwn @@ -3,9 +3,6 @@ all the other git clones, at both the git level and the key/value level. ## immediate action items -* There's apparently a race, as sometimes pausing a transfer causes it to start - one of the other queued transfers. - ## longer-term TODO * Test MountWatcher on LXDE. |