{"action":"created","issue":{"url":"https://api.github.com/repos/piwik/piwik/issues/7372","labels_url":"https://api.github.com/repos/piwik/piwik/issues/7372/labels{/name}","comments_url":"https://api.github.com/repos/piwik/piwik/issues/7372/comments","events_url":"https://api.github.com/repos/piwik/piwik/issues/7372/events","html_url":"https://github.com/piwik/piwik/issues/7372","id":59980232,"number":7372,"title":"Invalidating the reports when importing visits: dead code + use case issue","user":{"login":"cbay","id":725049,"avatar_url":"https://avatars.githubusercontent.com/u/725049?v=3","gravatar_id":"","url":"https://api.github.com/users/cbay","html_url":"https://github.com/cbay","followers_url":"https://api.github.com/users/cbay/followers","following_url":"https://api.github.com/users/cbay/following{/other_user}","gists_url":"https://api.github.com/users/cbay/gists{/gist_id}","starred_url":"https://api.github.com/users/cbay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbay/subscriptions","organizations_url":"https://api.github.com/users/cbay/orgs","repos_url":"https://api.github.com/users/cbay/repos","events_url":"https://api.github.com/users/cbay/events{/privacy}","received_events_url":"https://api.github.com/users/cbay/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/piwik/piwik/labels/answered","name":"answered","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-03-05T16:53:52Z","updated_at":"2015-03-11T19:53:42Z","closed_at":"2015-03-06T02:45:52Z","body":"As I understand it, since commit fb91155043c2dd269f32e27962e3cbdb00ad0aad, archived reports are automatically invalidated when importing visits.\r\n\r\nFirst, there's dead code in misc/log-analytics/import_logs.py that declares the (now unused) --invalidate-dates option.\r\n\r\nSecond, since this option is gone, I now have an issue with my use case. Every few months, I run the archiving process (core:archive), and then purge the archive_* tables.\r\n\r\nFor example, say I do that after I have imported the logs until March, 3rd (timezone CET). Once the archive_* table are empty, I have to re-import the logs from March, 3rd and NOT invalidate the reports, because Piwik (I assume) works in UTC and would otherwise invalidate reports from the 2nd and 3rd March, as my log files span on two days (UTC).\r\n\r\nNow that --invalidate-dates is gone, I'm stuck. I suggest adding a --ignore-dates to the import_logs.py script, which would just ignore the specified dates (in UTC!).\r\n\r\nIf that solution is considered worthwhile, I can code it (as well as removing the dead code)."},"comment":{"url":"https://api.github.com/repos/piwik/piwik/issues/comments/78357252","html_url":"https://github.com/piwik/piwik/issues/7372#issuecomment-78357252","issue_url":"https://api.github.com/repos/piwik/piwik/issues/7372","id":78357252,"user":{"login":"cbay","id":725049,"avatar_url":"https://avatars.githubusercontent.com/u/725049?v=3","gravatar_id":"","url":"https://api.github.com/users/cbay","html_url":"https://github.com/cbay","followers_url":"https://api.github.com/users/cbay/followers","following_url":"https://api.github.com/users/cbay/following{/other_user}","gists_url":"https://api.github.com/users/cbay/gists{/gist_id}","starred_url":"https://api.github.com/users/cbay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbay/subscriptions","organizations_url":"https://api.github.com/users/cbay/orgs","repos_url":"https://api.github.com/users/cbay/repos","events_url":"https://api.github.com/users/cbay/events{/privacy}","received_events_url":"https://api.github.com/users/cbay/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T19:53:42Z","updated_at":"2015-03-11T19:53:42Z","body":"Thanks. I guess I'll have to use Piwik to purge log_* to avoid this issue rather than TRUNCATE'ing the tables myself."}}