Merge branch 'master' of 192.168.0.27:dev0/PriceSystem
This commit is contained in:
@@ -7,6 +7,7 @@ import sell_price
|
||||
import fangjia
|
||||
import datetime
|
||||
import pytz
|
||||
import os
|
||||
|
||||
QUEUE = "calc_cmd"
|
||||
redis_pool = redis.ConnectionPool(host=config.get_redis_host(), port=6379, db=config.get_redis_db())
|
||||
@@ -47,6 +48,11 @@ def format_cmd(cmd):
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
pid_file = open("/var/run/price.sys.pid", "w")
|
||||
pid_file.write(str(os.getpid()))
|
||||
pid_file.flush()
|
||||
pid_file.close()
|
||||
|
||||
pro_num = config.get_worker_num()
|
||||
pool = multiprocessing.Pool(processes=pro_num)
|
||||
for pid in range(0, pro_num):
|
||||
|
||||
@@ -23,7 +23,7 @@ client = redis.Redis(connection_pool=redisPool)
|
||||
def get_district():
|
||||
seaweeds = []
|
||||
keys = {"city": 1, "region": 1, "name": 1, "_id": 0}
|
||||
for dis in fangjia.get_collection("fangjia", "seaweed").find({"cat": "district", "status": 0, "city": "上海"}, keys):
|
||||
for dis in fangjia.get_collection("fangjia", "seaweed").find({"cat": "district", "status": 0, "city": "合肥"}, keys):
|
||||
dis["weekend"] = datetime.strptime("2018-03-11", "%Y-%m-%d")
|
||||
seaweeds.append(dis)
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@ def monitor(pname):
|
||||
while True:
|
||||
pre_counter = client.llen(QUEUE)
|
||||
time.sleep(60)
|
||||
print(pname + "#####################################:".zfill(100) + str(
|
||||
pre_counter - client.llen(QUEUE)) + "/min")
|
||||
print(pname + "#####################################:".zfill(100) + str(pre_counter - client.llen(QUEUE)) + "/min")
|
||||
|
||||
|
||||
def format_cmd(cmd):
|
||||
|
||||
Reference in New Issue
Block a user