diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 47a3a95d1207a..99947a11a4b34 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -2768,9 +2768,13 @@ end Controls whether Active Job's `#perform_later` and similar methods automatically defer the job queuing to after the current Active Record transaction is committed. -It can be set to `:never` to never defer the enqueue, to `:always` always defer -the enqueue, or to `:default` to let the queue adapter define if it should be defered -or not. Active Job backends that use the same database than Active Record as a queue, +It can be set to: + +* `:never` - Never defer the enqueue. +* `:always` - Always defer the enqueue. +* `:default` - Let the queue adapter define the behaviour. + +Active Job backends that use the same database as Active Record as a queue, should generally prevent the deferring, and others should allow it. Example: @@ -2783,8 +2787,8 @@ end ``` In this example, if the configuration is set to `:never`, the job will -be enqueued immediately, even thought the `Topic` hasn't been committed yet. -Because of this, if the job is picked up almost emmediately, or if the +be enqueued immediately, even though the `Topic` hasn't been committed yet. +Because of this, if the job is picked up almost immediately, or if the transaction doesn't succeed for some reason, the job will fail to find this topic in the database. diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt index 42169ab6dcdd5..9a96a61dbd0ea 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_2.rb.tt @@ -19,12 +19,14 @@ # NewTopicNotificationJob.perform_later(topic) # end # -# In this example, if `enqueue_after_transaction_commit` is `false` the job will -# be enqueued immediately, even thought the `Topic` hasn't been committed yet. -# Because of this, if the job is picked up almost emmediately, it will fail to -# find this topic in the databse. -# With `enqueue_after_transaction_commit = true`, the job will be actually enqueued -# after the transaction has been committed. +# In this example, if the configuration is set to `:never`, the job will +# be enqueued immediately, even though the `Topic` hasn't been committed yet. +# Because of this, if the job is picked up almost immediately, or if the +# transaction doesn't succeed for some reason, the job will fail to find this +# topic in the database. +# +# If `enqueue_after_transaction_commit` is set to `:default`, the queue adapter +# will define the behaviour. # # Note: Active Job backends can disable this feature. This is generally used by # backends that use the same database than Active Record as a queue, hence they