diff options
-rw-r--r-- | Assistant.hs | 2 | ||||
-rw-r--r-- | Assistant/Threads/ConfigMonitor.hs | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Assistant.hs b/Assistant.hs index 6e24573ac..cb94ca462 100644 --- a/Assistant.hs +++ b/Assistant.hs @@ -203,7 +203,7 @@ startAssistant assistant daemonize webappwaiter = withThreadState $ \st -> do , assist $ netWatcherThread st dstatus scanremotes , assist $ netWatcherFallbackThread st dstatus scanremotes , assist $ transferScannerThread st dstatus scanremotes transferqueue - , assist $ configMonitorThread st dstatus branchhandle + , assist $ configMonitorThread st dstatus branchhandle commitchan , watch $ watchThread st dstatus transferqueue changechan ] waitForTermination diff --git a/Assistant/Threads/ConfigMonitor.hs b/Assistant/Threads/ConfigMonitor.hs index 1dcf44b2d..cfd3ca7d9 100644 --- a/Assistant/Threads/ConfigMonitor.hs +++ b/Assistant/Threads/ConfigMonitor.hs @@ -11,6 +11,7 @@ import Assistant.Common import Assistant.BranchChange import Assistant.ThreadedMonad import Assistant.DaemonStatus +import Assistant.Commits import Utility.ThreadScheduler import Logs.UUID import Logs.Trust @@ -23,6 +24,7 @@ import qualified Git.LsTree as LsTree import qualified Annex.Branch import qualified Annex +import Data.Time.Clock import qualified Data.Set as S thisThread :: ThreadName @@ -36,8 +38,8 @@ thisThread = "ConfigMonitor" - if the branch has not changed in a while, configuration changes will - be detected immediately. -} -configMonitorThread :: ThreadState -> DaemonStatusHandle -> BranchChangeHandle -> NamedThread -configMonitorThread st dstatus branchhandle = thread $ do +configMonitorThread :: ThreadState -> DaemonStatusHandle -> BranchChangeHandle -> CommitChan -> NamedThread +configMonitorThread st dstatus branchhandle commitchan = thread $ do r <- runThreadState st Annex.gitRepo go r =<< getConfigs r where @@ -52,6 +54,10 @@ configMonitorThread st dstatus branchhandle = thread $ do debug thisThread $ "reloading config" : map fst (S.toList changedconfigs) reloadConfigs st dstatus changedconfigs + {- Record a commit to get this config + - change pushed out to remotes. -} + time <- getCurrentTime + recordCommit commitchan (Commit time) go r new {- Config files, and their checksums. -} |