diff --git a/lbry/extras/daemon/loggly_handler.py b/lbry/extras/daemon/loggly_handler.py index 4e5888d52..f69c245ef 100644 --- a/lbry/extras/daemon/loggly_handler.py +++ b/lbry/extras/daemon/loggly_handler.py @@ -68,7 +68,11 @@ class HTTPSLogglyHandler(logging.Handler): return await self._emit(record, retry=False) def emit(self, record): - asyncio.ensure_future(self._emit(record)) + try: + asyncio.ensure_future(self._emit(record), loop=self._loop) + except RuntimeError: # TODO: use a second loop + print(f"\nfailed to send traceback to loggly, please file an issue with the following traceback:\n" + f"{self.format(record)}") def close(self): super().close() diff --git a/lbry/wallet/database.py b/lbry/wallet/database.py index eec048a2d..738ecba72 100644 --- a/lbry/wallet/database.py +++ b/lbry/wallet/database.py @@ -417,7 +417,7 @@ class Database(SQLiteMixin): }, 'txid = ?', (tx.id,))) def _transaction_io(self, conn: sqlite3.Connection, tx: Transaction, address, txhash): - conn.execute(*self._insert_sql('tx', self.tx_to_row(tx), replace=True)) + conn.execute(*self._insert_sql('tx', self.tx_to_row(tx), replace=True)).fetchall() for txo in tx.outputs: if txo.script.is_pay_pubkey_hash and txo.pubkey_hash == txhash: