mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2025-12-14 08:06:23 +08:00
[Bug fix] Import way to run
- Fix a bug that if you import the main app, especially when using gunicorn, you will miss some necessary initial operations. #216
This commit is contained in:
@@ -89,7 +89,7 @@ It is just so interesting. What it can do is under exploration.
|
||||
> 其它小改动请参考各个 commit 信息。
|
||||
> Please refer to the commit messages for other minor changes.
|
||||
|
||||
### Version 2.12.0
|
||||
### Version 2.12.1
|
||||
|
||||
> v2.12.0.1 ~ v2.12.0.10 for Arcaea 5.10.6 ~ 6.7.1
|
||||
>
|
||||
|
||||
@@ -170,7 +170,7 @@ def generate_log_file_dict(level: str, filename: str) -> dict:
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
def pre_main():
|
||||
log_dict = {
|
||||
'version': 1,
|
||||
'root': {
|
||||
@@ -208,6 +208,8 @@ def main():
|
||||
input('Press ENTER key to exit.')
|
||||
sys.exit()
|
||||
|
||||
|
||||
def main():
|
||||
if Config.LINKPLAY_HOST and Config.SET_LINKPLAY_SERVER_AS_SUB_PROCESS:
|
||||
from linkplay_server import link_play
|
||||
process = [Process(target=link_play, args=(
|
||||
@@ -223,6 +225,9 @@ def main():
|
||||
tcp_server_run()
|
||||
|
||||
|
||||
# must run for init
|
||||
pre_main()
|
||||
|
||||
if __name__ == '__main__':
|
||||
set_start_method("spawn")
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user