Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to archiver to not create archives for segments for today #14834

Merged
merged 5 commits into from Oct 2, 2019

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Aug 29, 2019

Unless the segment was created recently (in the last 24 hours).

At first I had a different implementation only in CronArchiver and it worked but problem was that when it archives current week, month, year it would still archive today again. This is why a mixed implementation was needed.

It can be triggered using core:archive --skip-segments-today

@mattab could you have a look at this?

@tsteur tsteur added the Needs Review PRs that need a code review label Aug 29, 2019
@tsteur tsteur added this to the 3.12.0 milestone Aug 29, 2019
@tsteur
Copy link
Member Author

tsteur commented Sep 10, 2019

@mattab if you could have a look here that be great

foreach ($allSegments as $segment) {
if ($segment['definition'] === $definition) {
$twentyFourHoursAgo = Date::now()->subHour(24);
return Date::factory($segment['ts_created'])->isLater($twentyFourHoursAgo);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use ts_created but could we instead use ts_last_edit? For the use case where user is updating the segment after a few days, and would also expect the segment to be processed soon after the modification (ideally).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the PR to look at that also

@mattab
Copy link
Member

mattab commented Oct 1, 2019

PR works 👍

Does this feature need to be documented in a FAQ or guide? (don't think so)

@tsteur tsteur merged commit d86ad31 into 3.x-dev Oct 2, 2019
@tsteur tsteur deleted the segmentnotoday branch October 2, 2019 03:05
@mattab mattab added the c: Performance For when we could improve the performance / speed of Matomo. label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants