skip some errors

This commit is contained in:
Ping Xiao 2023-05-24 19:47:56 +08:00
parent 137a9eb602
commit f2b438622a
1 changed files with 11 additions and 10 deletions

View File

@ -2043,6 +2043,7 @@ class TdSuperTable:
for topic in current_topic_list:
topic_list.append(topic)
try:
consumer.subscribe(topic_list)
# consumer with random work life
@ -2052,9 +2053,9 @@ class TdSuperTable:
consumer.commit(res)
if time.time() - time_start > random.randint(5, 50):
break
try:
consumer.unsubscribe()
except TmqError as e:
consumer.close()
except TmqError as err: # topic deleted by other threads
pass
return