Merge branch 'master' of http://gitlab.fangjia.com/dev0/PriceSystem
增加涨跌幅较大小区
This commit is contained in:
@@ -32,11 +32,26 @@ def get_district(city):
|
|||||||
keys = {"city": 1, "region": 1, "name": 1, "_id": 0}
|
keys = {"city": 1, "region": 1, "name": 1, "_id": 0}
|
||||||
for dis in fangjia.get_collection("fangjia", "seaweed", config.get_seaweed_host()).find({"cat": "district", "status": 0, "city": city}, keys):
|
for dis in fangjia.get_collection("fangjia", "seaweed", config.get_seaweed_host()).find({"cat": "district", "status": 0, "city": city}, keys):
|
||||||
dis["weekend"] = weekend
|
dis["weekend"] = weekend
|
||||||
seaweeds.append(dis)
|
if "region" in dis and not has_price(dis["city"], dis["region"], dis['name']):
|
||||||
|
seaweeds.append(dis)
|
||||||
|
else:
|
||||||
|
logger.info(str(dis) + "放弃")
|
||||||
return seaweeds
|
return seaweeds
|
||||||
|
|
||||||
|
|
||||||
|
def has_price(city, region, name):
|
||||||
|
weekend = fangjia.get_weekend()
|
||||||
|
district_stat = fangjia.get_collection("fangjia", "district_stat", config.get_district_stat_host(),
|
||||||
|
config.get_district_stat_port())
|
||||||
|
query = {
|
||||||
|
"city": city,
|
||||||
|
"region": region,
|
||||||
|
"district_name": name,
|
||||||
|
"weekend": weekend
|
||||||
|
}
|
||||||
|
return district_stat.find_one(query) is not None
|
||||||
|
|
||||||
|
|
||||||
def send_cmd(seaweed):
|
def send_cmd(seaweed):
|
||||||
json_cmd = json.dumps(seaweed, ensure_ascii=False, cls=CJsonEncoder)
|
json_cmd = json.dumps(seaweed, ensure_ascii=False, cls=CJsonEncoder)
|
||||||
client.rpush(QUEUE, json_cmd)
|
client.rpush(QUEUE, json_cmd)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ def get_worker_num():
|
|||||||
获取进行均价计算的进程数
|
获取进行均价计算的进程数
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
return 20
|
return 40
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user