Rails allows specifying the maximum number of records that will be destroyed in a single background job. | Saeloun Blog

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 #blog #records https://rubyonrails.ba/single/rails-allows-specifying-the-maximum-number-of-records-that-will-be-destroyed-in-a-single-background-job-saeloun-blog

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles