fix logic errors in code that determines if it's time for v10 upgrade
authorJoey Hess <joeyh@joeyh.name>
Mon, 25 Jul 2022 19:56:33 +0000 (15:56 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 25 Jul 2022 19:56:33 +0000 (15:56 -0400)
This would have prevented old git-annex from ever upgrading from v9 to
v10. Note that a manual `git-annex upgrade` can never run while the
assistant is running, so not <$> assistantrunning was always True,
so no matter what the timestamp of the v9 upgrade in the log, it would
decide there was old process danger.

Sponsored-by: Jack Hill on Patreon
Upgrade/V9.hs

index 06e2c558594043105c7e26c7038dcb4e93f7aa30..61f256e24c8c8aa4207b38bc5d300cfdbba9bc3a 100644 (file)
@@ -43,9 +43,9 @@ upgrade automatic
                Nothing -> pure True
                Just t -> do
                        now <- liftIO getPOSIXTime
-                       if now - 365*24*60*60 > t
+                       if now < t + 365*24*60*60
                                then return True
-                               else not <$> assistantrunning
+                               else assistantrunning
 
        {- Skip upgrade when git-annex assistant (or watch) is running,
         - because these are long-running daemons that could conceivably