Skip to content

Commit 2f026b9

Browse files
committed
fix: ip的获取,由 hosts = search_best_tdx() 来得到
1 parent 360e1f6 commit 2f026b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hikyuu/gui/data/ImportHistoryFinanceTask.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from pytdx.hq import TdxHq_API
3131
from hikyuu.data.pytdx_finance_to_mysql import history_finance_import_mysql
3232
from hikyuu.data.pytdx_finance_to_sqlite import history_finance_import_sqlite
33+
from hikyuu.data.common_pytdx import search_best_tdx
3334
from hikyuu.util import *
3435

3536

@@ -47,7 +48,9 @@ def __init__(self, log_queue, queue, config, dest_dir):
4748

4849
def connect(self):
4950
self.api = TdxHq_API()
50-
hku_check(self.api.connect('120.76.152.87', 7709), "failed connect pytdx!")
51+
hosts = search_best_tdx()
52+
hku_check(self.api.connect(hosts[0][2], hosts[0][3]), "failed connect pytdx {}:{}!", hosts[0][2], hosts[0][3])
53+
#hku_check(self.api.connect('120.76.152.87', 7709), "failed connect pytdx!")
5154

5255
def get_list_info(self):
5356
result = []

0 commit comments

Comments
 (0)