forked from LBRYCommunity/lbry-sdk
Merge pull request #2720 from lbryio/loggly-database-error
fix database error caused by logging tracebacks from within the sqlite transaction runner
This commit is contained in:
commit
1a0d805bad
2 changed files with 6 additions and 2 deletions
|
@ -68,7 +68,11 @@ class HTTPSLogglyHandler(logging.Handler):
|
||||||
return await self._emit(record, retry=False)
|
return await self._emit(record, retry=False)
|
||||||
|
|
||||||
def emit(self, record):
|
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):
|
def close(self):
|
||||||
super().close()
|
super().close()
|
||||||
|
|
|
@ -417,7 +417,7 @@ class Database(SQLiteMixin):
|
||||||
}, 'txid = ?', (tx.id,)))
|
}, 'txid = ?', (tx.id,)))
|
||||||
|
|
||||||
def _transaction_io(self, conn: sqlite3.Connection, tx: Transaction, address, txhash):
|
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:
|
for txo in tx.outputs:
|
||||||
if txo.script.is_pay_pubkey_hash and txo.pubkey_hash == txhash:
|
if txo.script.is_pay_pubkey_hash and txo.pubkey_hash == txhash:
|
||||||
|
|
Loading…
Add table
Reference in a new issue