切花DB
This commit is contained in:
@@ -18,7 +18,7 @@ def worker():
|
|||||||
client = redis.Redis(connection_pool=redis_pool)
|
client = redis.Redis(connection_pool=redis_pool)
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
cmd = client.lpop(QUEUE)
|
cmd = client.blpop(QUEUE, 60)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
cmd = None
|
cmd = None
|
||||||
print(ex)
|
print(ex)
|
||||||
|
|||||||
@@ -44,3 +44,11 @@ def get_timeout():
|
|||||||
|
|
||||||
def get_seawater_host():
|
def get_seawater_host():
|
||||||
return "seawater.db.fangjia.com"
|
return "seawater.db.fangjia.com"
|
||||||
|
|
||||||
|
|
||||||
|
def get_seaweed_host():
|
||||||
|
return "192.168.10.182"
|
||||||
|
|
||||||
|
|
||||||
|
def get_seaweed_port():
|
||||||
|
return 27017
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ def dis_feature(query, fields=None):
|
|||||||
|
|
||||||
raise Exception("yang ben cha xun shi bai1")
|
raise Exception("yang ben cha xun shi bai1")
|
||||||
|
|
||||||
|
@timer
|
||||||
def find_seaweed(query, fields=None):
|
def find_seaweed(query, fields=None):
|
||||||
# dirlt=p[0]
|
# dirlt=p[0]
|
||||||
|
|
||||||
@@ -305,24 +305,20 @@ def find_seaweed(query, fields=None):
|
|||||||
# db1 = client1.fangjia
|
# db1 = client1.fangjia
|
||||||
# seaweed1 = db1.seaweed
|
# seaweed1 = db1.seaweed
|
||||||
# s = time.time()
|
# s = time.time()
|
||||||
seawater105 = get_collection("fangjia", "seaweed", "192.168.0.136", 27017)
|
seawater105 = get_collection("fangjia", "seaweed", config.get_seaweed_host(), config.get_seaweed_port())
|
||||||
for err_count in range(0, 10):
|
for err_count in range(0, 10):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# print('flag5')
|
# print('flag5')
|
||||||
lt = seawater105.count(query)
|
|
||||||
|
|
||||||
pos = list(seawater105.find(query).limit(lt))
|
pos = list(seawater105.find(query))
|
||||||
data = pandas.DataFrame(pos)
|
data = pandas.DataFrame(pos)
|
||||||
del pos
|
del pos
|
||||||
# print("==================>", time.time() - s)
|
# print("==================>", time.time() - s)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
except:
|
except:
|
||||||
|
pos = list(seawater105.find(query))
|
||||||
# err_count = err_count + 1
|
|
||||||
lt = seawater105.count(query)
|
|
||||||
pos = list(seawater105.find(query).limit(lt))
|
|
||||||
data = pandas.DataFrame(pos)
|
data = pandas.DataFrame(pos)
|
||||||
del pos
|
del pos
|
||||||
return data
|
return data
|
||||||
@@ -335,7 +331,7 @@ def find_region_district_list_name(query, fields=None):
|
|||||||
# client1 = pymongo.MongoClient('192.168.0.136',27017)
|
# client1 = pymongo.MongoClient('192.168.0.136',27017)
|
||||||
# db1 = client1.fangjia
|
# db1 = client1.fangjia
|
||||||
# seaweed1 = db1.seaweed
|
# seaweed1 = db1.seaweed
|
||||||
seawater105 = get_collection("fangjia", "seaweed", "192.168.0.136", 27017)
|
seawater105 = get_collection("fangjia", "seaweed", config.get_seaweed_host(), config.get_seaweed_port())
|
||||||
for err_count in range(0, 10):
|
for err_count in range(0, 10):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user