forked from LBRYCommunity/lbry-sdk
debug badrow
This commit is contained in:
parent
211f8b2e59
commit
4d1eafc0a4
1 changed files with 16 additions and 1 deletions
|
@ -568,7 +568,22 @@ class BulkLoader:
|
||||||
execute = self.ctx.connection.execute
|
execute = self.ctx.connection.execute
|
||||||
for sql, rows in queries:
|
for sql, rows in queries:
|
||||||
for chunk_rows in chunk(rows, batch_size):
|
for chunk_rows in chunk(rows, batch_size):
|
||||||
|
try:
|
||||||
execute(sql, chunk_rows)
|
execute(sql, chunk_rows)
|
||||||
|
except:
|
||||||
|
for row in chunk_rows:
|
||||||
|
try:
|
||||||
|
execute(sql, [row])
|
||||||
|
except:
|
||||||
|
print(sql)
|
||||||
|
print(row)
|
||||||
|
with open('badrow', 'wb') as badrow:
|
||||||
|
badrow.write(str(sql).encode())
|
||||||
|
badrow.write(repr(row).encode())
|
||||||
|
p.ctx.message_queue.put_nowait(
|
||||||
|
(Event.COMPLETE.value, os.getpid(), 1, 1)
|
||||||
|
)
|
||||||
|
raise
|
||||||
if p:
|
if p:
|
||||||
done += int(len(chunk_rows)/row_scale)
|
done += int(len(chunk_rows)/row_scale)
|
||||||
p.step(done)
|
p.step(done)
|
||||||
|
|
Loading…
Reference in a new issue