David 1 month ago
parent
commit
fe8e0d7581
2 changed files with 4 additions and 3 deletions
  1. 1 1
      common/logs.py
  2. 3 2
      data_processing/data_operation/pre_prod_ftp.py

+ 1 - 1
common/logs.py

@@ -81,7 +81,7 @@ class DailyRotatingFileHandler(BaseRotatingHandler):
         计算当前时间对应的日志文件名
         """
 
-        return f"ap-{self.logs_name}" + "." + time.strftime(self.suffix, time.localtime()) + '.' + str(seg) +'.log'
+        return f"{self.logs_name}" + "." + time.strftime(self.suffix, time.localtime()) + '.' + str(seg) +'.log'
 
     def _open(self):
         """

+ 3 - 2
data_processing/data_operation/pre_prod_ftp.py

@@ -27,6 +27,7 @@ import paramiko
 import zipfile
 from datetime import datetime, timedelta
 from typing import Optional
+from pytz import timezone
 import shutil
 import tempfile
 api_url = 'http://itil.jiayuepowertech.com:9958/itil/api/stationModelConfig'
@@ -38,7 +39,7 @@ nick_name = {
 model_type_dict = {
     'cdq': '0',
     'dq': '1',
-    'czq': '2'
+    'zcq': '2'
 }
 # 配置信息
 SFTP_HOST = '192.168.1.33'
@@ -100,7 +101,7 @@ def model_station_handler(api_data):
 def get_next_target_time(current_time=None):
     """获取下一个目标时刻"""
     if current_time is None:
-        current_time = datetime.now()
+        current_time = datetime.now(timezone('Asia/Shanghai'))
 
     target_hours = [0, 6, 12, 18]
     current_hour = current_time.hour