I am using async_observer plug-in.
I am having two models Listener and Webhits, in which Listener has_many webhits is the association.
When I am deleting Listener It should delete all the webhits corresponding to that Listener.
When the data is less every thing is fine and corresponding data(webhits) are deleting.
Now In My Database each Listener is holding more than 2lakhs of records.
When I am trying to delete Listener I am getting ana error and Mysql is not responding.
@listener is my Listener object
In my Controller, destroy method I added the following line
@listener.async_send(:destroy). because I am using async_observer plug-in.
But Its not deleting if the listener is having more records and Mysql getting hang.
Can any one suggest me how to delete the records batch wise(10,000) from my DB so that Mysql might not hangs.
Thanks In advance.