@tsteur opened this Issue on March 8th 2016 Member

See https://github.com/piwik/piwik/blob/2.16.1-b1/plugins/CoreAdminHome/API.php#L65

The API method says on can use a range date, which is technically true. However, it will simply convert all set dates into range dates. Eg when passing 2016-02-10,2016-02-23 it will invalidate the range dates 2016-02-10,2016-02-10 and 2016-02-23,2016-02-23 which doesn't make any sense since it's simply a single day.

Instead the API should eg require that a number of dates is given that is dividable by 2 numberOfDates % 2 == 0. We can then for example always concatenate two dates to build an actual range date. This is kind of changing API behaviour but current way wouldn't invalidate anything. And in case this is actually wanted we could still on top invalidate each single day as well like it was done before.

@mattab commented on January 23rd 2020 Member

It was maybe implemented in https://github.com/matomo-org/matomo/pull/14450 and https://github.com/matomo-org/matomo/issues/14178
but not sure if it's working still, as i'm not able to make it work.

I tried to invalidate a date range with:./console core:invalidate-report-data --periods=range --sites=1 --dates=2020-01-21,2020-01-22 but it didn't show any output, the command simply returned without error or message.
And after running ./core core:archive the date range Jan 21st-22nd, was still not reprocessed and showed the old reports.

Maybe the feature in #14450 doesn't actually work yet?

@tsteur commented on January 23rd 2020 Member

Not sure what's not working for you. Maybe you want a different feature?

For me it executes these queries:

'UPDATE archive_numeric_2020_01 SET value = 4 WHERE name LIKE \'done%\'
                   AND idsite IN (1)
                   AND ((period = 5 AND ((date2 >= ? AND date1 <= ?))))

You can add --dry-run and get some output.

Powered by GitHub Issue Mirror