@@ -59,8 +59,8 @@ def update_all_user(self, dt_transfer):
59
59
self .traffic_rate , 'user_id' : self .port_uid_table [id ]})
60
60
update_transfer [id ] = dt_transfer [id ]
61
61
webapi .postApi ('users/traffic' ,
62
- {'node_id' : get_config ().NODE_ID },
63
- {'data' : data })
62
+ {'node_id' : get_config ().NODE_ID },
63
+ {'data' : data })
64
64
65
65
webapi .postApi (
66
66
'nodes/%d/info' %
@@ -76,8 +76,8 @@ def update_all_user(self, dt_transfer):
76
76
for ip in online_iplist [port ]:
77
77
data .append ({'ip' : ip , 'user_id' : self .port_uid_table [port ]})
78
78
webapi .postApi ('users/aliveip' ,
79
- {'node_id' : get_config ().NODE_ID },
80
- {'data' : data })
79
+ {'node_id' : get_config ().NODE_ID },
80
+ {'data' : data })
81
81
82
82
detect_log_list = ServerPool .get_instance ().get_servers_detect_log ()
83
83
data = []
@@ -86,8 +86,8 @@ def update_all_user(self, dt_transfer):
86
86
data .append ({'list_id' : rule_id ,
87
87
'user_id' : self .port_uid_table [id ]})
88
88
webapi .postApi ('users/detectlog' ,
89
- {'node_id' : get_config ().NODE_ID },
90
- {'data' : data })
89
+ {'node_id' : get_config ().NODE_ID },
90
+ {'data' : data })
91
91
92
92
deny_str = ""
93
93
data = []
@@ -144,8 +144,8 @@ def update_all_user(self, dt_transfer):
144
144
deny_file .write (deny_str + "\n " )
145
145
deny_file .close ()
146
146
webapi .postApi ('func/block_ip' ,
147
- {'node_id' : get_config ().NODE_ID },
148
- {'data' : data })
147
+ {'node_id' : get_config ().NODE_ID },
148
+ {'data' : data })
149
149
return update_transfer
150
150
151
151
def uptime (self ):
@@ -653,8 +653,7 @@ def thread_db(obj):
653
653
trace = traceback .format_exc ()
654
654
logging .error (trace )
655
655
#logging.warn('db thread except:%s' % e)
656
- if db_instance .event .wait (
657
- get_config ().MYSQL_UPDATE_TIME ) or not db_instance .is_all_thread_alive ():
656
+ if db_instance .event .wait (60 ) or not db_instance .is_all_thread_alive ():
658
657
break
659
658
except KeyboardInterrupt as e :
660
659
pass
0 commit comments