assistant: On Linux, the expensive transfer scan is run niced.

This is a compromise. I would like to nice every thread except for the
webapp thread, but it's not practical to do so. That would need every
thread to run as a bound thread, which could add significant overhead.
And any forkIO would escape the nice level.
This commit is contained in:
Joey Hess 2013-06-20 21:10:16 -04:00
parent bfd3bba093
commit 6e309b63f8
4 changed files with 46 additions and 1 deletions

View file

@ -24,6 +24,7 @@ import qualified Remote
import qualified Types.Remote as Remote
import Utility.ThreadScheduler
import Utility.NotificationBroadcaster
import Utility.Batch
import qualified Git.LsFiles as LsFiles
import qualified Backend
import Annex.Content
@ -114,7 +115,7 @@ failedTransferScan r = do
- since we need to look at the locations of all keys anyway.
-}
expensiveScan :: UrlRenderer -> [Remote] -> Assistant ()
expensiveScan urlrenderer rs = unless onlyweb $ do
expensiveScan urlrenderer rs = unless onlyweb $ batch <~> do
debug ["starting scan of", show visiblers]
unwantedrs <- liftAnnex $ S.fromList