mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-12 02:57:26 +08:00
[Enhance] Performance optimization
- Change journal mode to WAL and enlarge cache size for sqlite3 database - Use monkey patch to do asynchrony - Make gevent use Flask's logger
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from .config_manager import Config
|
||||
|
||||
ARCAEA_SERVER_VERSION = 'v2.10.0.2'
|
||||
ARCAEA_SERVER_VERSION = 'v2.10.0.3'
|
||||
|
||||
|
||||
class Constant:
|
||||
|
||||
@@ -258,13 +258,17 @@ class UserPlay(UserScore):
|
||||
|
||||
def get_play_state(self) -> None:
|
||||
'''检查token,当然这里不管有没有,是用来判断世界模式和课题模式的'''
|
||||
if self.token == '1145141919810':
|
||||
# 硬编码检查,绕过数据库
|
||||
self.is_world_mode = False
|
||||
self.course_play_state = -1
|
||||
return None
|
||||
|
||||
self.c.execute(
|
||||
'''select * from songplay_token where token=:a ''', {'a': self.song_token})
|
||||
x = self.c.fetchone()
|
||||
if not x:
|
||||
self.is_world_mode = False
|
||||
self.course_play_state = -1
|
||||
return None
|
||||
raise NoData('No token data.')
|
||||
self.song.set_chart(x[2], x[3])
|
||||
if x[4]:
|
||||
self.course_play = CoursePlay(self.c, self.user, self)
|
||||
|
||||
@@ -12,8 +12,8 @@ class Connect:
|
||||
|
||||
def __init__(self, file_path=Constant.SQLITE_DATABASE_PATH):
|
||||
"""
|
||||
数据库连接,默认连接arcaea_database.db\
|
||||
接受:文件路径\
|
||||
数据库连接,默认连接arcaea_database.db\
|
||||
接受:文件路径\
|
||||
返回:sqlite3连接操作对象
|
||||
"""
|
||||
self.file_path = file_path
|
||||
|
||||
Reference in New Issue
Block a user