[hooks] fix timestamp confusion in TransactionsCleanupStartupHook
transactions.tx_time is inserted as datetime.utcnow(), in
server/sources/native.py:NativeSQLSource.start_undoable_transaction.
Don't compare it to datetime.now().
--- a/hooks/__init__.py Thu Dec 10 12:34:15 2015 +0100
+++ b/hooks/__init__.py Wed Dec 09 13:58:03 2015 +0100
@@ -33,7 +33,7 @@
# which may cause reloading pb
lifetime = timedelta(days=self.repo.config['keep-transaction-lifetime'])
def cleanup_old_transactions(repo=self.repo, lifetime=lifetime):
- mindate = datetime.now() - lifetime
+ mindate = datetime.utcnow() - lifetime
with repo.internal_cnx() as cnx:
cnx.system_sql(
'DELETE FROM transactions WHERE tx_time < %(time)s',