skip some errors
This commit is contained in:
parent
137a9eb602
commit
f2b438622a
|
@ -2043,18 +2043,19 @@ class TdSuperTable:
|
||||||
for topic in current_topic_list:
|
for topic in current_topic_list:
|
||||||
topic_list.append(topic)
|
topic_list.append(topic)
|
||||||
|
|
||||||
consumer.subscribe(topic_list)
|
|
||||||
|
|
||||||
# consumer with random work life
|
|
||||||
time_start = time.time()
|
|
||||||
while 1:
|
|
||||||
res = consumer.poll(1)
|
|
||||||
consumer.commit(res)
|
|
||||||
if time.time() - time_start > random.randint(5, 50):
|
|
||||||
break
|
|
||||||
try:
|
try:
|
||||||
|
consumer.subscribe(topic_list)
|
||||||
|
|
||||||
|
# consumer with random work life
|
||||||
|
time_start = time.time()
|
||||||
|
while 1:
|
||||||
|
res = consumer.poll(1)
|
||||||
|
consumer.commit(res)
|
||||||
|
if time.time() - time_start > random.randint(5, 50):
|
||||||
|
break
|
||||||
consumer.unsubscribe()
|
consumer.unsubscribe()
|
||||||
except TmqError as e:
|
consumer.close()
|
||||||
|
except TmqError as err: # topic deleted by other threads
|
||||||
pass
|
pass
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue