This commit is contained in:
yumoqing 2026-04-09 23:05:08 +08:00
parent 04c6195720
commit 2b48dbe094
3 changed files with 12 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import sys
import codecs
from urllib.parse import quote
import json
import uvloop
import asyncio
from contextlib import asynccontextmanager
@ -260,9 +261,16 @@ async def sqlorContext(module):
def background_reco(reco, *args, **kw):
asyncio.create_task(reco(*args, **kw))
def get_loop_type():
loop = asyncio.get_event_loop()
if isinstance(loop, uvloop.Loop):
return 'uvloop.Loop'
return str(type(loop))
def initEnv():
g = ServerEnv()
set_builtins()
g.get_loop_type = get_loop_type()
rf = RegisterFunction()
rf.register('i18n', i18n)
g.paramify = paramify

View File

@ -1,3 +1,5 @@
import uvloop
uvloop.install()
import os, sys
import argparse
from appPublic.log import MyLogger, info, debug, warning

View File

@ -11,6 +11,8 @@ license = MIT
packages = find:
python_requires = >=3.8
install_requires =
uvloop
httptools
redis
asyncio
aiofiles