停止消费
This commit is contained in:
parent
75bca68aeb
commit
4a670de26b
9
app.py
9
app.py
@ -54,15 +54,16 @@ class XProcess(Process):
|
||||
elif type_ == settings.STOP_SIGNAL:
|
||||
# continue
|
||||
# 1 小时内有效
|
||||
self.log.info(type_)
|
||||
if msg.get('#time', 0) + 3600 < int(time.time()):
|
||||
continue
|
||||
kafka_client.close()
|
||||
# 停止消费kafka
|
||||
print(f'进程{self.partition} 等待90秒')
|
||||
self.log.info(f'进程{self.partition} 等待90秒')
|
||||
time.sleep(90)
|
||||
print(f'进程{self.partition} 写入数据')
|
||||
self.log.info(f'进程{self.partition} 写入数据')
|
||||
transmitter.run()
|
||||
print(f'进程{self.partition} 结束')
|
||||
self.log.info(f'进程{self.partition} 结束')
|
||||
|
||||
break
|
||||
else:
|
||||
@ -72,4 +73,4 @@ class XProcess(Process):
|
||||
|
||||
while True:
|
||||
time.sleep(5)
|
||||
print(f'消费分区{self.partition} 已结束。。。')
|
||||
self.log.info(f'消费分区{self.partition} 已结束。。。')
|
||||
|
Loading…
Reference in New Issue
Block a user