summaryrefslogtreecommitdiff
path: root/Assistant.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-28 14:04:28 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-28 14:04:28 -0400
commit7024a973b222c32f44a7168532afae520e7474ed (patch)
tree36dc8bccf53e19eecc29d6343b786637e01bf70c /Assistant.hs
parent9ea389ee2f741b4b7af69c02a6376a0a4cf7feb8 (diff)
add download progress polling thread
Diffstat (limited to 'Assistant.hs')
-rw-r--r--Assistant.hs18
1 files changed, 11 insertions, 7 deletions
diff --git a/Assistant.hs b/Assistant.hs
index 413e5e90e..42175dd82 100644
--- a/Assistant.hs
+++ b/Assistant.hs
@@ -39,30 +39,32 @@
- and maintains the DaemonStatus currentTransfers map.
- (This uses inotify on .git/annex/transfer/, so there are
- additional inotify threads associated with it, too.)
- - Thread 10: Transferrer
+ - Thread 10: TransferPoller
+ - Polls to determine how much of each ongoing transfer is complete.
+ - Thread 11: Transferrer
- Waits for Transfers to be queued and does them.
- - Thread 11: StatusLogger
+ - Thread 12: StatusLogger
- Wakes up periodically and records the daemon's status to disk.
- - Thread 12: SanityChecker
+ - Thread 13: SanityChecker
- Wakes up periodically (rarely) and does sanity checks.
- - Thread 13: MountWatcher
+ - Thread 14: MountWatcher
- Either uses dbus to watch for drive mount events, or, when
- there's no dbus, polls to find newly mounted filesystems.
- Once a filesystem that contains a remote is mounted, updates
- state about that remote, pulls from it, and queues a push to it,
- as well as an update, and queues it onto the
- ConnectedRemoteChan
- - Thread 13: NetWatcher
+ - Thread 15: NetWatcher
- Deals with network connection interruptions, which would cause
- transfers to fail, and can be recovered from by waiting for a
- network connection, and syncing with all network remotes.
- Uses dbus to watch for network connections, or when dbus
- cannot be used, assumes there's been one every 30 minutes.
- - Thread 15: TransferScanner
+ - Thread 16: TransferScanner
- Does potentially expensive checks to find data that needs to be
- transferred from or to remotes, and queues Transfers.
- Uses the ScanRemotes map.
- - Thread 16: WebApp
+ - Thread 17: WebApp
- Spawns more threads as necessary to handle clients.
- Displays the DaemonStatus.
-
@@ -118,6 +120,7 @@ import Assistant.Threads.SanityChecker
import Assistant.Threads.MountWatcher
import Assistant.Threads.NetWatcher
import Assistant.Threads.TransferScanner
+import Assistant.Threads.TransferPoller
#ifdef WITH_WEBAPP
import Assistant.Threads.WebApp
#else
@@ -168,6 +171,7 @@ startAssistant assistant daemonize webappwaiter = do
, assist $ pushRetryThread st dstatus pushmap
, assist $ mergeThread st
, assist $ transferWatcherThread st dstatus
+ , assist $ transferPollerThread st dstatus
, assist $ transfererThread st dstatus transferqueue transferslots
, assist $ daemonStatusThread st dstatus
, assist $ sanityCheckerThread st dstatus transferqueue changechan