implement daemon status serialization to a file

Also afterLastDaemonRun, with 10 minute slop to handle majority of clock
skew issues.
This commit is contained in:
Joey Hess 2012-06-13 13:35:15 -04:00
parent ccc5005245
commit ff2414427b
3 changed files with 55 additions and 5 deletions

View file

@ -154,10 +154,8 @@ onAddSymlink file filestatus dstatus = go =<< Backend.lookupFile file
| scanComplete daemonstatus = addlink link
| otherwise = case filestatus of
Just s
| safe (statusChangeTime s) -> noChange
| not (afterLastDaemonRun (statusChangeTime s) daemonstatus) -> noChange
_ -> addlink link
where
safe t = maybe True (> t) (lastRunning daemonstatus)
{- For speed, tries to reuse the existing blob for
- the symlink target. -}