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