diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-26 12:42:58 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-26 12:42:58 -0400 |
commit | 956694b88fff7bc151bad6196ed429e0db7b23cb (patch) | |
tree | 07237216bb2c9854d19a3664413b1311f472ad27 /Assistant.hs | |
parent | fdec6d27c4d32b9d641d17336b6be4a91c1d3fc4 (diff) |
assistant: When autostarted, wait 5 seconds before running the startup scan, to avoid contending with the user's desktop login process.
Diffstat (limited to 'Assistant.hs')
-rw-r--r-- | Assistant.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Assistant.hs b/Assistant.hs index 8a0c574ab..5eeba818e 100644 --- a/Assistant.hs +++ b/Assistant.hs @@ -48,6 +48,7 @@ import Assistant.Types.UrlRenderer import qualified Utility.Daemon import Utility.LogFile import Utility.ThreadScheduler +import Utility.HumanTime import qualified Build.SysConfig as SysConfig import System.Log.Logger @@ -61,8 +62,8 @@ stopDaemon = liftIO . Utility.Daemon.stopDaemon =<< fromRepo gitAnnexPidFile - - startbrowser is passed the url and html shim file, as well as the original - stdout and stderr descriptors. -} -startDaemon :: Bool -> Bool -> Maybe HostName -> Maybe (Maybe Handle -> Maybe Handle -> String -> FilePath -> IO ()) -> Annex () -startDaemon assistant foreground listenhost startbrowser = do +startDaemon :: Bool -> Bool -> Maybe Duration -> Maybe HostName -> Maybe (Maybe Handle -> Maybe Handle -> String -> FilePath -> IO ()) -> Annex () +startDaemon assistant foreground startdelay listenhost startbrowser = do Annex.changeState $ \s -> s { Annex.daemon = True } pidfile <- fromRepo gitAnnexPidFile logfile <- fromRepo gitAnnexLogFile @@ -140,7 +141,7 @@ startDaemon assistant foreground listenhost startbrowser = do , watch $ watchThread -- must come last so that all threads that wait -- on it have already started waiting - , watch $ sanityCheckerStartupThread + , watch $ sanityCheckerStartupThread startdelay ] liftIO waitForTermination |