Skip to content

Commit

Permalink
🎨 格式化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
SilianZ committed Apr 27, 2024
1 parent 5a0d04f commit bb3ac7a
Show file tree
Hide file tree
Showing 17 changed files with 353 additions and 224 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

🎉 __*新增功能!*__ WebDAV 支持。通过基于 Web 的分布式编写和版本控制(英语:Web-based Distributed Authoring and Versioning,缩写:WebDAV),用户可以协同编辑和管理存储在万维网服务器文件。


</div>

# 简介
Expand Down
14 changes: 9 additions & 5 deletions core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,27 @@
from .scheduler import exit as scheduler_exit
from .utils import WaitLock

env['MONOTONIC'] = time.monotonic()
env['STARTUP'] = time.time()
env["MONOTONIC"] = time.monotonic()
env["STARTUP"] = time.time()

wait_exit: WaitLock = WaitLock()


def init():
wait_exit.acquire()
logger.tinfo("core.info.loading")
version = sys.version_info
logger.tinfo("core.info.python_version",
v=f"{version.major}.{version.minor}.{version.micro}")
logger.tinfo(
"core.info.python_version", v=f"{version.major}.{version.minor}.{version.micro}"
)
atexit.register(exit)
try:
asyncio.run(async_init())
except KeyboardInterrupt:
if wait_exit.locked:
wait_exit.release()


async def async_init():
# first init
await scheduler_init()
Expand All @@ -36,13 +39,14 @@ async def async_init():
from .cluster import exit as cluster_exit
from .stats import init as stats_init
from .update import init as update_init

update_init()
scheduler.delay(network_init)
stats_init()
await cluster_init()

await wait_exit.wait()
env['EXIT'] = True
env["EXIT"] = True
network_exit()
await cluster_exit()
scheduler_exit()
Expand Down
1 change: 1 addition & 0 deletions core/certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def load_text(cert: str, key: str):
if load_cert(cert_file, key_file):
logger.tsuccess("cert.success.loaded_cert")
from core.network import restart

restart()
cert_file.unlink()
key_file.unlink()
Loading

0 comments on commit bb3ac7a

Please sign in to comment.