Refresh Solr stock after ordering
We have a business requirement that forced us to do a live refresh of stocks in Solr every after a user orders. What I did was created a new action in our orderProcess.xml that will put a lock, run our cronjob that will do the indexing, wait until the cronjob finishes then release the lock after. This caused an issue wherein our order confirmation emails were not sending because the lock got stuck and multiple business processes were affected because the lock was not yet ready. We were able to resolve this by temporarily introducing a new dynamic process definition without the new action and setting it in store level.