[hooks] fix timestamp confusion in DataImportsCleanupStartupHook
CWDataImport.start_timestamp is inserted as datetime.utcnow(), in
server/sources/datafeed.py:DataFeedSourceinit_import_log.
Don't compare it to datetime.now().
--- a/hooks/__init__.py Wed Dec 09 13:58:03 2015 +0100
+++ b/hooks/__init__.py Wed Dec 09 14:06:43 2015 +0100
@@ -77,7 +77,7 @@
or not repo.config.source_enabled(source)):
continue
with repo.internal_cnx() as cnx:
- mindate = datetime.now() - timedelta(seconds=source.config['logs-lifetime'])
+ mindate = datetime.utcnow() - timedelta(seconds=source.config['logs-lifetime'])
cnx.execute('DELETE CWDataImport X WHERE X start_timestamp < %(time)s',
{'time': mindate})
cnx.commit()