Don't needlessly enter transaction

This commit is contained in:
Erik Johnston 2016-05-06 11:25:58 +01:00
parent 56b5e83e36
commit 1d275dba69

View file

@ -159,10 +159,8 @@ class TransactionStore(SQLBaseStore):
self.inflight_transactions.setdefault(destination, {})[transaction_id] = txn_row self.inflight_transactions.setdefault(destination, {})[transaction_id] = txn_row
# TODO: Fetch prev_txns
return self.runInteraction( return self.runInteraction(
"prep_send_transaction", "_get_prevs_txn",
self._get_prevs_txn, self._get_prevs_txn,
destination, destination,
) )
@ -350,6 +348,7 @@ class TransactionStore(SQLBaseStore):
] ]
def f(txn): def f(txn):
if full_rows:
self._simple_insert_many_txn( self._simple_insert_many_txn(
txn=txn, txn=txn,
table="sent_transactions", table="sent_transactions",
@ -371,6 +370,7 @@ class TransactionStore(SQLBaseStore):
} }
) )
if full_rows or update_delivered:
yield self.runInteraction("_persist_in_mem_txns", f) yield self.runInteraction("_persist_in_mem_txns", f)
except: except:
logger.exception("Failed to persist transactions!") logger.exception("Failed to persist transactions!")