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

Move recalculation of content lengths to background job #498

Merged
merged 3 commits into from
Oct 28, 2023

Conversation

robbevp
Copy link
Member

@robbevp robbevp commented Oct 27, 2023

Fixes #497

I moved the iteration over all audio files to its own job. We'd want to run ContentLength.destroy_all ASAP after boot, since a version mismatch could result in issues for users. If this turns out to still be a bottleneck, we can also switch to ContentLength.delete_all (as we don't have any lifecycle callbacks for content lengths, or need to delete associated models when destroying).

  • I've added tests relevant to my changes.

@robbevp robbevp requested a review from chvp October 27, 2023 16:24
@robbevp robbevp self-assigned this Oct 27, 2023
@robbevp robbevp force-pushed the fix/background-job-recalculate-content-lengths branch from b62f4f6 to 86f1974 Compare October 27, 2023 18:35
Copy link
Member

@chvp chvp left a comment

Choose a reason for hiding this comment

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

Just some questions on the tests, but I see that the same thing was also in the previous tests, so maybe it's not necessary to fix it here?

test/jobs/recalculate_content_lengths_job_test.rb Outdated Show resolved Hide resolved
@robbevp
Copy link
Member Author

robbevp commented Oct 28, 2023

Not sure how that got there - I'd rather fix this while we're at it.
I cleaned up the tests so that all shared setup is only present in the setup.

@robbevp robbevp requested a review from chvp October 28, 2023 14:35
test/jobs/recalculate_content_lengths_job_test.rb Outdated Show resolved Hide resolved
@chvp chvp merged commit 368da2b into main Oct 28, 2023
2 checks passed
@chvp chvp deleted the fix/background-job-recalculate-content-lengths branch October 28, 2023 15:32
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.

ffmpeg:check_version takes a very long time if the version changed
2 participants