Commit 338a6a4e authored by liyuanhong's avatar liyuanhong

修改了一个bug3

parent 9b558d2c
...@@ -427,6 +427,7 @@ class M500PressureServer(): ...@@ -427,6 +427,7 @@ class M500PressureServer():
self.fireOn() self.fireOn()
time.sleep(2) time.sleep(2)
self.startTravelService() self.startTravelService()
time.sleep(180)
except BaseException as e: except BaseException as e:
traceback.print_exc() traceback.print_exc()
self.info["threadsObj"].pop(self.threadName) self.info["threadsObj"].pop(self.threadName)
...@@ -441,7 +442,7 @@ class M500PressureServer(): ...@@ -441,7 +442,7 @@ class M500PressureServer():
print(self.threadName + "线程出现异常\n") print(self.threadName + "线程出现异常\n")
self.writeToFile("data/log1.txt",self.threadName + "线程出现异常\n", type=1) self.writeToFile("data/log1.txt",self.threadName + "线程出现异常\n", type=1)
if (self.durTime - (endTime - self.startTime)) > 180: if (self.durTime - (endTime - self.startTime)) > 180:
time.sleep(180) pass
else: else:
break break
if self.threadName in self.info["threadsObj"]: if self.threadName in self.info["threadsObj"]:
......
...@@ -15,8 +15,8 @@ def writeToFile(path,data,type=1): #1:代表追加 0:代表覆盖 ...@@ -15,8 +15,8 @@ def writeToFile(path,data,type=1): #1:代表追加 0:代表覆盖
with open(path, "w", encoding='utf-8') as fi: with open(path, "w", encoding='utf-8') as fi:
fi.write(data) fi.write(data)
carNums = 4000 #模拟器数量 carNums = 300 #模拟器数量
durTime = 3600 #线程持续的时间 durTime = 25200 #线程持续的时间
startDin = 202008280000 #开始的车机号 startDin = 202008280000 #开始的车机号
info = {} #存放脚本运行时的信息 info = {} #存放脚本运行时的信息
info["threadsObj"] = {} #用于运行线程的字典 info["threadsObj"] = {} #用于运行线程的字典
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment