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

Seed database with inline ActiveJob job adapter #34953

Merged
merged 1 commit into from Jan 17, 2019

Conversation

Projects
None yet
2 participants
@gmcgibbon
Copy link
Member

commented Jan 17, 2019

Summary

Closes #34939.

It appears that ActiveStorage enqueues ActiveStorage::AnalyzeJobs when attaching a file. This prompts ActiveJob to enqueue jobs (via the async queue adapter by default in development) and can cause problems for one-off scripts such as database seeding.

This may also be a symptom of a bigger problem with ActiveStorage's queueing assumptions, or maybe the async job adapter. For now, I think temporarily setting the queue adapter to inline for all seeding in all environments is reasonable.

@rails-bot rails-bot bot added the railties label Jan 17, 2019


boot_rails

assert_equal ActiveJob::QueueAdapters::InlineAdapter, Rails.application.load_seed

This comment has been minimized.

Copy link
@rafaelfranca

rafaelfranca Jan 17, 2019

Member

I think this doesn't do what you want. Rails.application.load_seed will return true.

@gmcgibbon gmcgibbon force-pushed the gmcgibbon:seed_with_inline_jobs branch from 1b04af9 to cc8e86e Jan 17, 2019

@gmcgibbon gmcgibbon force-pushed the gmcgibbon:seed_with_inline_jobs branch from cc8e86e to 66cc0e7 Jan 17, 2019

@rafaelfranca rafaelfranca merged commit 2dee59f into rails:master Jan 17, 2019

2 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@gmcgibbon gmcgibbon deleted the gmcgibbon:seed_with_inline_jobs branch Jan 17, 2019

rafaelfranca added a commit that referenced this pull request Jan 17, 2019

Merge pull request #34953 from gmcgibbon/seed_with_inline_jobs
Seed database with inline ActiveJob job adapter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.