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

misc(daily_usage): Extract daily_usage history from rake task to a service #2843

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

vincent-pochet
Copy link
Collaborator

Context

A rake task to fill the history data of the DailyUsage model was recently added (#2751)

Since this task is recomputing the usage for all subscriptions of an organization for a defined number of days, without taking advantage of the usage cache, it can be very slow. Also, an organization can have a large number of subscription, making the current linear approach very inefficient.

Description

This PR extracts the existing logic from the rake task itself in a job/service, taking advantage of sidekiq to parralelize the work

@vincent-pochet vincent-pochet force-pushed the misc-extract-daily-usage-history branch from 3c5a99f to 0d9c017 Compare November 21, 2024 12:44
@vincent-pochet vincent-pochet merged commit 2c97be8 into main Nov 21, 2024
6 checks passed
@vincent-pochet vincent-pochet deleted the misc-extract-daily-usage-history branch November 21, 2024 14:48
vincent-pochet added a commit that referenced this pull request Nov 21, 2024
## Context

Related to #2843

## Description

We missed to move the `require "timecop"` 🤦 ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants