This commit is contained in:
aozhiwei 2020-12-04 10:49:32 +08:00
parent cecfda90fb
commit 5b0463bede

View File

@ -21,6 +21,7 @@ import functools
CONFIG_DIR = '../config' if f7.isOnlineEnv() else '/var/data/conf_test/game2004api_rankserver/config'
RANK_KEY_PREFIX = 'game2004api:'
DBNAME_PREFIX = 'gamedb2004_'
IGNORE_GUESET_ACCOUNT = 0
def _take_pass(elem):
return elem[3]
@ -137,6 +138,9 @@ def fullUpdateRank():
has_data = False
for row in cursor:
has_data = True
last_idx = max(row[8], last_idx)
if IGNORE_GUESET_ACCOUNT and (row[1] == '游客' or row[1] == '极乐玩家'):
continue
#更新击杀榜
channel = f7.getChannelByAccountId(row[0])
if checkchannel(channel):
@ -155,7 +159,6 @@ def fullUpdateRank():
if channel not in integral_hash:
integral_hash[channel] = []
_refreshData(row, integral_hash[channel], take_integral_times)
last_idx = max(row[8], last_idx)
time.sleep(0.001);
if not has_data:
break
@ -203,6 +206,9 @@ def incrementUpdateRank():
for row in cursor:
has_data = True
channel = f7.getChannelByAccountId(row[0])
last_idx = max(row[8], last_idx)
if IGNORE_GUESET_ACCOUNT and (row[1] == '游客' or row[1] == '极乐玩家'):
continue
if checkchannel(channel):
#更新击杀榜
if channel not in kill_hash:
@ -222,7 +228,6 @@ def incrementUpdateRank():
integral_hash[channel] = [] if not integral_list else json.loads(integral_list)
_delRepeatData(row, integral_hash[channel])
_refreshData(row, integral_hash[channel], take_integral_times)
last_idx = max(row[8], last_idx)
time.sleep(0.001);
if not has_data:
break
@ -250,6 +255,7 @@ if __name__ == "__main__":
conf = json.loads(open(CONFIG_DIR + '/rankserver.json', 'r').read())
RANK_KEY_PREFIX = conf.get('key_prefix', RANK_KEY_PREFIX)
DBNAME_PREFIX = conf.get('dbname_prefix', DBNAME_PREFIX)
IGNORE_GUESET_ACCOUNT = conf.get('ignore_guest_account', IGNORE_GUESET_ACCOUNT)
conf['rushtime'] = 300
f7.timer.callLater(conf['rushtime'],