Forráskód Böngészése

fix:wind新增一个错误code码,碰到就重启python

Roc 5 hónapja
szülő
commit
630b9595a1
1 módosított fájl, 3 hozzáadás és 0 törlés
  1. 3 0
      wind_api.py

+ 3 - 0
wind_api.py

@@ -38,6 +38,9 @@ def GetEdbDataByWind(EdbCode, StartDate, EndDate):
     if data.ErrorCode == -40521010:  # Internet Timeout 超时退出
         os._exit(0)
         return "a"
+    if data.ErrorCode == -40521009:  # corrupted response. 错误响应也重启
+        os._exit(0)
+        return "b"
     df['DT'] = data.Times
     df['CLOSE'] = data.Data[0]
     df['ErrorCode'] = data.ErrorCode