Rails allows specifying the maximum number of records that will be destroyed in a single background job. | Saeloun Blog
16-Jun-2022 902
Rails 6 had added the :destroy_async option to delete the associated records in a background job whenever the foreign_key constraint would be disabled.But what if the associated records are too large? In this case, by default, the single background job will delete all of them and that can be time-consuming. To handle this, and make it fast, Rails now allows adding the active record configuration to specify the maximum number of records that will be destroyed in a single background job and enqueue additional jobs when the number of records exceeds that limit.
Rails allows specifying the maximum number of records that will be destroyed in a single background job. | Saeloun Blog #ruby #rubydeveloper #rubyonrails #Rails #allows #specifying #maximum #number #records #destroyed #single #background #Saeloun #blog #records https://rubyonrails.ba/link/rails-allows-specifying-the-maximum-number-of-records-that-will-be-destroyed-in-a-single-background-job-saeloun-blog