@@ -37,51 +37,11 @@ def auto_block_thread(self):
37
37
38
38
if configloader .get_config ().API_INTERFACE == "modwebapi" :
39
39
# 读取节点IP
40
- # SELECT * FROM `ss_node` where `node_ip` != ''
41
40
node_ip_list = []
42
41
data = webapi .getApi ("nodes" )
43
42
for node in data :
44
43
temp_list = node ["node_ip" ].split ("," )
45
44
node_ip_list .append (temp_list [0 ])
46
- else :
47
- import cymysql
48
-
49
- if configloader .get_config ().MYSQL_SSL_ENABLE == 1 :
50
- conn = cymysql .connect (
51
- host = configloader .get_config ().MYSQL_HOST ,
52
- port = configloader .get_config ().MYSQL_PORT ,
53
- user = configloader .get_config ().MYSQL_USER ,
54
- passwd = configloader .get_config ().MYSQL_PASS ,
55
- db = configloader .get_config ().MYSQL_DB ,
56
- charset = "utf8" ,
57
- ssl = {
58
- "ca" : configloader .get_config ().MYSQL_SSL_CA ,
59
- "cert" : configloader .get_config ().MYSQL_SSL_CERT ,
60
- "key" : configloader .get_config ().MYSQL_SSL_KEY ,
61
- },
62
- )
63
- else :
64
- conn = cymysql .connect (
65
- host = configloader .get_config ().MYSQL_HOST ,
66
- port = configloader .get_config ().MYSQL_PORT ,
67
- user = configloader .get_config ().MYSQL_USER ,
68
- passwd = configloader .get_config ().MYSQL_PASS ,
69
- db = configloader .get_config ().MYSQL_DB ,
70
- charset = "utf8" ,
71
- )
72
- conn .autocommit (True )
73
-
74
- # 读取节点IP
75
- # SELECT * FROM `ss_node` where `node_ip` != ''
76
- node_ip_list = []
77
- cur = conn .cursor ()
78
- cur .execute (
79
- "SELECT `node_ip` FROM `ss_node` where `node_ip` != ''"
80
- )
81
- for r in cur .fetchall ():
82
- temp_list = str (r [0 ]).split ("," )
83
- node_ip_list .append (temp_list [0 ])
84
- cur .close ()
85
45
86
46
deny_file = open ("/etc/hosts.deny" )
87
47
fcntl .flock (deny_file .fileno (), fcntl .LOCK_EX )
0 commit comments