This commit is contained in:
wuaho 2021-05-11 15:08:55 +08:00
parent cbaac95cca
commit 324de690ce
5 changed files with 9 additions and 5 deletions

View File

@ -17,7 +17,7 @@ class Config:
# 每个游戏不一样
'group_id': 'legu_group3'
}
# 游戏数据库名
GAME = 'shjy'
# REDIS_CONF = {

2
stop.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
echo `pstree -p 20015`|awk 'BEGIN{ FS="(" ; RS=")" } NF>1 { print $NF }'|xargs kill &>/dev/null

View File

@ -1,4 +1,4 @@
create view shjy.user_view as select *
from shjy.user
order by `#role_create_time` desc
order by `#reg_time` desc
LIMIT 1 by `#account_id`

View File

@ -65,10 +65,12 @@ class CK:
data, columns = self.__client.execute(sql, columnar=True, with_column_types=True)
except Exception as e:
traceback.print_exc()
if e.code == 60:
return self.get_all(db, 'user', where, try_cnt - 1)
self.__client.disconnect()
self.__client = self.__create_client()
if try_cnt > 0:
self.get_all(db, tb, where, try_cnt - 1)
return self.get_all(db, tb, where, try_cnt - 1)
# 异常导致导致 避免认为用户不存在
if data is None:

View File

@ -60,7 +60,7 @@ class Sketch:
self.db_client.execute(sql)
sql = f"""create view {db}.user_view as select *
from {db}.user
order by `#role_create_time` desc
order by `#reg_time` desc
LIMIT 1 by `#account_id`"""
self.db_client.execute(sql)
@ -107,6 +107,6 @@ class Sketch:
print(f'添加字段 {k} 失败')
default_field.pop(k)
if set(default_field) - keys:
if tb=='user' and set(default_field) - keys:
self.up_tb_struct(db, tb, default_field)
self.update_user_view(db, tb)