Commit eb522ccf authored by Jérome Perrin's avatar Jérome Perrin

administration: fix incremental consistency check for non UTC timezone

last_active_process.getStartDate() is in Zope timezone, we should not
just pass a string representation to catalog but pass a DateTime
instance instead, to let catalog convert the date to UTC (because
catalog tables have UTC dates).

Where it gets more complicated is that unlike all DATETIME columns in
catalog that are UTC, indexation_timestamp is a TIMESTAMP column, which
depend on MySQL timezone settings. This also depend assume that MySQL is
configured with an UTC timezone.
parent 93cb35e1
...@@ -3,7 +3,10 @@ kw = {} ...@@ -3,7 +3,10 @@ kw = {}
if context.getProperty('incremental_check'): if context.getProperty('incremental_check'):
last_active_process = context.getLastActiveProcess() last_active_process = context.getLastActiveProcess()
if last_active_process is not None: if last_active_process is not None:
kw['indexation_timestamp'] = '>= %s' % last_active_process.getStartDate().ISO() kw['indexation_timestamp'] = {
'query': last_active_process.getStartDate(),
'range': '>='
}
active_process = context.newActiveProcess().getRelativeUrl() active_process = context.newActiveProcess().getRelativeUrl()
query_string = context.getProperty('catalog_query_string', '') query_string = context.getProperty('catalog_query_string', '')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment