提交 71c65de8 作者: XveLingKun

es操做

上级 c4d07ea0
...@@ -24,7 +24,7 @@ cursor_ = cnx_.cursor() ...@@ -24,7 +24,7 @@ cursor_ = cnx_.cursor()
lock = threading.Lock() lock = threading.Lock()
pool = redis.ConnectionPool(host="114.115.236.206", port=6379, password='clbzzsn', db=6) pool = redis.ConnectionPool(host="114.116.90.53", port=6380, password='clbzzsn', db=6)
class EsMethod(object): class EsMethod(object):
...@@ -47,10 +47,10 @@ if __name__ == "__main__": ...@@ -47,10 +47,10 @@ if __name__ == "__main__":
redis_conn = redis.Redis(connection_pool=pool) redis_conn = redis.Redis(connection_pool=pool)
while True: while True:
# 从redis中读取数据,去附件表中根据title查询,更新查到的附件id # 从redis中读取数据,去附件表中根据title查询,更新查到的附件id
item = redis_conn.lpop('91330000747735638J:id') item = redis_conn.lpop('NianbaoOT:id')
if item: if item:
log.info(item) log.info(item)
id = int(item.decode().split('|')[0]) id = int(item.decode())
try: try:
esMethod.delete(esMethod.index_name,id) esMethod.delete(esMethod.index_name,id)
except Exception as e: except Exception as e:
......
...@@ -26,7 +26,7 @@ lock = threading.Lock() ...@@ -26,7 +26,7 @@ lock = threading.Lock()
pathType = 'QYNotice/' pathType = 'QYNotice/'
taskType = '企业研报/东方财富网' taskType = '企业研报/东方财富网'
pool = redis.ConnectionPool(host="114.115.236.206", port=6379, password='clbzzsn', db=6) pool = redis.ConnectionPool(host="114.116.90.53", port=6380, password='clbzzsn', db=6)
class EsMethod(object): class EsMethod(object):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论