소스 검색

设置服务器重启机制

maohu 3 주 전
부모
커밋
ba0e58666e
2개의 변경된 파일8개의 추가작업 그리고 13개의 파일을 삭제
  1. 2 7
      scheduleCenter.py
  2. 6 6
      unitls/settings.py

+ 2 - 7
scheduleCenter.py

@@ -11,12 +11,12 @@ from apscheduler.events import EVENT_JOB_EXECUTED , EVENT_JOB_ERROR
 from apscheduler.executors.pool import ThreadPoolExecutor , ProcessPoolExecutor
 from apscheduler.schedulers.background import BlockingScheduler
 from unitls.settings import softVersion
-oldVersion,nowVersion=softVersion()
+oldVersion,nowVersion = softVersion()
 current_path = os.getcwd()
 if nowVersion:
     path = os.path.join(current_path,nowVersion)
 else:
-    path=None
+    path = None
 #oldVersion="ServerWithJWT.exe"
 #nowVersion="ServerWithJWT.exe"
 #path=os.path.join("D:\\flightinfoV3_sever\dist\ServerWithJWT.exe")
@@ -77,11 +77,6 @@ def restart():
         RestartSts=False
         print(f"【{datetime.datetime.now()}】重启环节结束")
 def generate_signature() :
-    """
-    生成请求签名
-    :param data: 请求的JSON数据
-    :return: (时间戳, 签名)
-    """
 
     # 1. 获取当前Unix时间戳(秒级)
     timestamp = str(int(time.time()))

+ 6 - 6
unitls/settings.py

@@ -64,13 +64,13 @@ def DBServer():
         local_host = config.get('DBserver', 'local_host')
         local_port = config.get('DBserver', 'local_port')
         local_user = "user1"           #config.get('DBserver', 'local_user')
-        local_password = "a123456s"    #config.get('DBserver', 'local_password')
-        #local_password = "m6kJzXPMbuMq"    #config.get('DBserver', 'local_password')
+        #local_password = "a123456s"    #config.get('DBserver', 'local_password')
+        local_password = "m6kJzXPMbuMq"    #config.get('DBserver', 'local_password')
         online_host = config.get('DBserver', 'online_host')
         online_port = config.get('DBserver', 'online_port')
         online_user = "user1"            #config.get('DBserver', 'online_user')
-        online_password = "a123456s"     #config.get('DBserver', 'online_password')
-        #online_password = "m6kJzXPMbuMq"     #config.get('DBserver', 'online_password')
+        #online_password = "a123456s"     #config.get('DBserver', 'online_password')
+        online_password = "m6kJzXPMbuMq"     #config.get('DBserver', 'online_password')
     else:
         local_host = None
         local_port = None
@@ -185,8 +185,8 @@ def softVersion():
     config = ConfigParser()
     config.read(ini_path, encoding='utf-8-sig')
     if config.has_section('softVersion'):
-        old = config.get('softVersion', 'SameDatabase')
-        now= config.get('softVersion', 'HighRefreh')
+        old = config.get('softVersion', 'old')
+        now= config.get('softVersion', 'new')
     else:
         old = None
         now = None