ipv6 fix
This commit is contained in:
parent
a5ddc3289a
commit
7c991e9d7f
2 changed files with 11 additions and 2 deletions
|
@ -89,16 +89,16 @@ class DbTransfer(object):
|
|||
@staticmethod
|
||||
def del_server_out_of_bound_safe(rows):
|
||||
#停止超流量的服务
|
||||
#启动没超流量的服务
|
||||
for row in rows:
|
||||
if ServerPool.get_instance().server_is_run(row[0]) > 0:
|
||||
if row[1] + row[2] >= row[3]:
|
||||
logging.info('db stop server at port [%s]' % (row[0]))
|
||||
ServerPool.get_instance().del_server(row[0])
|
||||
else:
|
||||
elif ServerPool.get_instance().server_run_status(row[0]) is False:
|
||||
if row[5] == 1 and row[6] == 1 and row[1] + row[2] < row[3]:
|
||||
logging.info('db start server at port [%s] pass [%s]' % (row[0], row[4]))
|
||||
ServerPool.get_instance().new_server(row[0], row[4])
|
||||
|
||||
@staticmethod
|
||||
def thread_db():
|
||||
import socket
|
||||
|
|
|
@ -80,6 +80,15 @@ class ServerPool(object):
|
|||
ret |= 2
|
||||
return ret
|
||||
|
||||
def server_run_status(self, port):
|
||||
if 'server' in self.config:
|
||||
if port not self.tcp_servers_pool:
|
||||
return False
|
||||
if 'server_ipv6' in self.config:
|
||||
if port not self.tcp_ipv6_servers_pool:
|
||||
return False
|
||||
return True
|
||||
|
||||
def new_server(self, port, password):
|
||||
ret = True
|
||||
port = int(port)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue