finish fixing windows timezone madness
Rather than calculating the TSDelta once, and caching it, this now reads the inode sential file's InodeCache file once, and then each time a new InodeCache is generated, looks at the sentinal file to get the current delta. This way, if the time zone changes while git-annex is running, it will adapt. This adds some inneffiency, but only on Windows, and only 1 stat per new file added. The worst innefficiency is that `git annex status` and `git annex sync` will now (on Windows) stat the inode sentinal file once per file in the repo. It would be more efficient to use getCurrentTimeZone, rather than needing to stat the sentinal file. This should be easy to do, once the time package gets my bugfix patch. This commit was sponsored by Jürgen Lüters.
This commit is contained in:
parent
e4d7e2ebde
commit
4fe2e53f5b
6 changed files with 39 additions and 25 deletions
|
@ -155,7 +155,7 @@ ingest (Just source) = withTSDelta $ \delta -> do
|
|||
backend <- chooseBackend $ keyFilename source
|
||||
k <- genKey source backend
|
||||
ms <- liftIO $ catchMaybeIO $ getFileStatus $ contentLocation source
|
||||
let mcache = toInodeCache delta =<< ms
|
||||
mcache <- maybe (pure Nothing) (liftIO . toInodeCache delta) ms
|
||||
case (mcache, inodeCache source) of
|
||||
(_, Nothing) -> go k mcache ms
|
||||
(Just newc, Just c) | compareStrong c newc -> go k mcache ms
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue