Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
magnetikonline / sendmailsink.sh
Last active November 7, 2017 10:54
Bash script to write/sink output sent to sendmail to a log file. Useful for debugging with PHP and other runtimes that talk to sendmail.
#!/bin/bash -e
# For PHP5 and /etc/php5/php.ini you would setup like so:
# sendmail_path = "/path/to/sendmailsink.sh"
LOG_FILE="/var/log/sendmailsink"
echo "$(date "+%Y-%m-%d @ %H:%M:%S") || $0 $*" >>$LOG_FILE
echo >>$LOG_FILE
@SchumacherFM
SchumacherFM / README.md
Last active September 21, 2018 10:05
Avoiding database deadlocks in Magento 1.7

After having many deadlocks due to a high order volumne I've applied the these fixes to the core. Some can be found in a Magento forum. Before the fixes we could only process 1 order every 5-10 secs. Updating to Magento 1.8 is currently not an option but in 1-2 months.

1st Deadlock

Mage_Sales_Model_Abstract::_afterSave must be removed and replaced with afterCommitCallback. This is important to move the grid update (of sales_flat_order_grid) out of the transaction.

2nd Deadlock

Rewrite the method of the Mage_CatalogInventory_Model_Observer::reindexQuoteInventory() to remove the price reindexing from the transaction. That index process will also be fired in event sales_model_service_quote_submit_success.