程序优化
This commit is contained in:
1 parent
e83deda268
commit
e1a7647fcb
16 files changed
+634
-91
No files matched your search
+8
-12
@@ -1,10 +1,10 @@
|
||||
import platform,sys,redis,time,requests,json
|
||||
import platform,sys,redis,time,requests,json,atexit
|
||||
if platform.system() == 'Windows':
|
||||
sys.path.append('e:\\libs\\')
|
||||
else:
|
||||
sys.path.append('/data/deploy/make3d/make2/libs/')
|
||||
|
||||
import config,libs,libs_db
|
||||
import config,libs,libs_db,common
|
||||
r = redis.Redis(host="106.14.158.208",password="kcV2000",port=6379,db=6)
|
||||
def getPSid(pid):
|
||||
res = requests.get("https://mp.api.suwa3d.com/api/customerP3dLog/photoStudio",params={"pid":pid})
|
||||
@@ -43,21 +43,17 @@ def readTask(key):
|
||||
print("走新的建模系统不是分布式插入-重建工单",key,pid,psid)
|
||||
libs_db.add_task(taskData)
|
||||
else:
|
||||
|
||||
if int(psid) == 41 or int(psid) == 85:
|
||||
taskData["priority"] = 0
|
||||
print("走分布式建模系统插入",key,pid,psid)
|
||||
libs_db.add_task_distributed(taskData)
|
||||
if libs_db.isStudioConfigDistribute(psid):
|
||||
print("走分布式建模系统插入",key,pid,psid)
|
||||
if int(psid) <= 90 and int(psid) != 29 and int(psid) != 56:
|
||||
print("走分布式建模",key,pid,psid)
|
||||
if int(psid) == 41 or int(psid) == 85:
|
||||
taskData["priority"] = 0
|
||||
libs_db.add_task_distributed(taskData)
|
||||
else:
|
||||
print("走新的建模系统不是分布式插入",key,pid,psid)
|
||||
print("非分布式建模",key,pid,psid)
|
||||
libs_db.add_task(taskData)
|
||||
|
||||
#程序主入口
|
||||
if __name__ == '__main__':
|
||||
|
||||
atexit.register(common.notify,"定时读取建模任务已经停止")
|
||||
#print(r.llen('model:make10'))
|
||||
#开启死循环
|
||||
while True:
|
||||
|
||||
Reference in new issue
Block a user