Added SERVER_EMAIL to prod settings. Added flush_transaction to scan_monitor in scan_engine so that the mysql connection is pinged before attempting a transaction.