Browse Source

新增 合法实体添加到Redis定时流程

znj 1 year ago
parent
commit
c2a7821c9a
1 changed files with 4 additions and 2 deletions
  1. 4 2
      BaseDataMaintenance/maintenance/enterprise/enterprise2Redis.py

+ 4 - 2
BaseDataMaintenance/maintenance/enterprise/enterprise2Redis.py

@@ -159,7 +159,9 @@ class enterprise2Redis():
         all_log_msg = []
         with open(log_path, mode='r', encoding='utf-8') as f:
             all_log_msg = f.readlines()
-            all_log_msg.remove('\n')
+            # all_log_msg.remove('\n')
+            if all_log_msg[-1]=='\n':
+                all_log_msg = all_log_msg[:-1]
 
         last_create_time = ""
         for _log in all_log_msg[::-1]:
@@ -183,7 +185,7 @@ class enterprise2Redis():
         else:
             log_msg = "%s Enterprise2redis status:failed, add legal name num: %d, add not legal name num: %d, last process time:%s" % \
                       ((time.strftime('%Y-%m-%d %H:%M:%S',time.localtime()),legal_name_num, not_legal_name_num, last_process_time))
-
+        log(log_msg)
         # 限制写入log最大记录数量
         all_log_msg = all_log_msg[-2000:]
         all_log_msg.append(log_msg + '\n')