summaryrefslogtreecommitdiff
path: root/Assistant.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-05 10:21:22 -0600
committerGravatar Joey Hess <joey@kitenet.net>2012-07-05 10:21:22 -0600
commit83c66ccaf88a10e8f4b16fc2162cbed2656b95e0 (patch)
tree6b1807e02096a81c96f788d3fd4305f89ea2018e /Assistant.hs
parentb0894f00c075e4dd93a692880e8eb0ea865b6c28 (diff)
queue Uploads of newly added files to remotes
Added knownRemotes to DaemonStatus. This list is not entirely trivial to calculate, and having it here should make it easier to add/remove remotes on the fly later on. It did require plumbing the daemonstatus through to some more threads.
Diffstat (limited to 'Assistant.hs')
-rw-r--r--Assistant.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Assistant.hs b/Assistant.hs
index 40f53d55e..548850e92 100644
--- a/Assistant.hs
+++ b/Assistant.hs
@@ -21,7 +21,8 @@
- until this is complete.
- Thread 5: committer
- Waits for changes to occur, and runs the git queue to update its
- - index, then commits.
+ - index, then commits. Also queues Transfer events to send added
+ - files to other remotes.
- Thread 6: pusher
- Waits for commits to be made, and pushes updated branches to remotes,
- in parallel. (Forks a process for each git push.)
@@ -73,6 +74,7 @@ import Assistant.DaemonStatus
import Assistant.Changes
import Assistant.Commits
import Assistant.Pushes
+import Assistant.TransferQueue
import Assistant.Threads.Watcher
import Assistant.Threads.Committer
import Assistant.Threads.Pusher
@@ -103,9 +105,10 @@ startDaemon assistant foreground
changechan <- newChangeChan
commitchan <- newCommitChan
pushmap <- newFailedPushMap
+ transferqueue <- newTransferQueue
mapM_ (void . forkIO)
- [ commitThread st changechan commitchan
- , pushThread st commitchan pushmap
+ [ commitThread st changechan commitchan transferqueue dstatus
+ , pushThread st dstatus commitchan pushmap
, pushRetryThread st pushmap
, mergeThread st
, transferWatcherThread st dstatus