peatio
peatio copied to clipboard
Use batch updates for canceling orders
https://github.com/rubykube/peatio/blob/d38ae99fde6aef3273176f55b51ab596cdbf4985/app/api/v2/market/orders.rb#L116
We should do something like this:
Order.where(state: 100).find_in_batches {|batch| batch.each {|o| Order.cancel(o.id)}}
Currently, it dosent delete all orders even if the user has like 50 orders. I think we should introduce a daemon that cancels the order.
Also same for creating accounts #2320 this issue can be fixed in a similar way
can you make a pull request?