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

Disable Podcast episodes fetching during seeding #3075

Merged
merged 1 commit into from
Jun 10, 2019
Merged

Disable Podcast episodes fetching during seeding #3075

merged 1 commit into from
Jun 10, 2019

Conversation

rhymes
Copy link
Contributor

@rhymes rhymes commented Jun 8, 2019

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

ActiveJob jobs are executed inline during rails db:reset which means that the app now that #3057 is in, tries to fetch 1000 episodes from each Podcast, which is really slow if successful at all (it crashed after a while on my machine).

This PR disables fetching during seeding. Episodes can be fetched with rails get_podcast_episodes task if needed for local testing.

I know @lightalloy is working on improving Podcast fetching but I believe this was an unintended side effect of the good work she's doing.

The fact that we have to disable a callback it's also a good argument against doing this kind of things in callbacks which hides a lot of business logic in the first place (by separating creation of an object and fetching of dependent objects for example) but that's an entirely different argument :-)

Related Tickets & Documents

#3057 and #2952

Added to documentation?

  • docs.dev.to
  • readme
  • no documentation needed

After #3057, that converts from Delayed::Job to ActiveJob, podcast episodes are fetched inline during seeding, which makes the seeding process painfully slow and most of the times unsuccessful.

This PR disables the fetching during seeding. Episodes can be fetched with `rails get_podcast_episodes` task if needed for local testing.
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Jun 8, 2019
@lightalloy
Copy link
Contributor

I agree that this kind of logic shouldn't be done in the callbacks, I'll consider changing it while working on the podcasts section.

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Jun 10, 2019
@benhalpern benhalpern merged commit 7d89a55 into forem:master Jun 10, 2019
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Jun 10, 2019
@rhymes rhymes deleted the rhymes/fix-podcast-fetching-after-create branch June 10, 2019 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants