Disable Podcast episodes fetching during seeding #3075
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
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?