set pull flag
This commit is contained in:
parent
0ed10c73c9
commit
b922d70a87
1 changed files with 5 additions and 0 deletions
|
@ -23,11 +23,14 @@ class TransferBase(object):
|
||||||
self.user_pass = {}
|
self.user_pass = {}
|
||||||
self.port_uid_table = {}
|
self.port_uid_table = {}
|
||||||
self.onlineuser_cache = lru_cache.LRUCache(timeout=60*30)
|
self.onlineuser_cache = lru_cache.LRUCache(timeout=60*30)
|
||||||
|
self.pull_ok = False
|
||||||
|
|
||||||
def load_cfg(self):
|
def load_cfg(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def push_db_all_user(self):
|
def push_db_all_user(self):
|
||||||
|
if self.pull_ok is False:
|
||||||
|
return
|
||||||
#更新用户流量到数据库
|
#更新用户流量到数据库
|
||||||
last_transfer = self.last_update_transfer
|
last_transfer = self.last_update_transfer
|
||||||
curr_transfer = ServerPool.get_instance().get_servers_transfer()
|
curr_transfer = ServerPool.get_instance().get_servers_transfer()
|
||||||
|
@ -179,6 +182,8 @@ class TransferBase(object):
|
||||||
try:
|
try:
|
||||||
db_instance.push_db_all_user()
|
db_instance.push_db_all_user()
|
||||||
rows = db_instance.pull_db_all_user()
|
rows = db_instance.pull_db_all_user()
|
||||||
|
if rows:
|
||||||
|
db_instance.pull_ok = True
|
||||||
db_instance.del_server_out_of_bound_safe(last_rows, rows)
|
db_instance.del_server_out_of_bound_safe(last_rows, rows)
|
||||||
last_rows = rows
|
last_rows = rows
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Add table
Reference in a new issue