停止入库信号

This commit is contained in:
wuaho 2021-08-02 13:37:38 +08:00
parent 1dc9f42471
commit 132f6cdb5c
2 changed files with 11 additions and 0 deletions

9
app.py
View File

@ -47,6 +47,15 @@ class XProcess(Process):
# continue
obj = getattr(handler_event, type_)
obj(msg)
elif type_ == settings.STOP_SIGNAL:
# 停止消费kafka
print(f'进程{self.partition} 等待90秒')
time.sleep(90)
print(f'进程{self.partition} 写入数据')
transmitter.run()
print(f'进程{self.partition} 结束')
break
else:
continue

View File

@ -29,6 +29,8 @@ class Config:
'decode_responses': True
}
STOP_SIGNAL = 'stop_MntxuXMc'
class Debug(Config):
pass