提交 fec91dc2 编写于 作者: D dingbo

docs: test

上级 e5bc9896
...@@ -65,15 +65,11 @@ def run_write_task(task_id: int, queue: Queue): ...@@ -65,15 +65,11 @@ def run_write_task(task_id: int, queue: Queue):
writer = SQLWriter(get_connection) writer = SQLWriter(get_connection)
lines = None lines = None
try: try:
count = 0
while True: while True:
try: try:
# get as many as possible # get as many as possible
lines = queue.get_many(block=False, max_messages_to_get=MAX_BATCH_SIZE) lines = queue.get_many(block=False, max_messages_to_get=MAX_BATCH_SIZE)
count += len(lines) writer.process_lines(lines)
if count % 1000000 == 0:
log.info(count)
# writer.process_lines(lines)
except Empty: except Empty:
time.sleep(0.01) time.sleep(0.01)
except KeyboardInterrupt: except KeyboardInterrupt:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册