Skip to content

Commit

Permalink
尝试解决mock server问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wuranxu committed Jul 4, 2022
1 parent 5453baa commit a5d4f5b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from app.routers.request import http
from app.routers.testcase import router as testcase_router
from app.routers.workspace import router as workspace_router
from app.utils.decorator import lock
from app.utils.scheduler import Scheduler
from config import Config, PITY_ENV, BANNER

Expand Down Expand Up @@ -139,13 +140,19 @@ def init_scheduler():


@pity.on_event('startup')
def init_proxy():
async def init_proxy():
"""
给你我的附属金卡,默认开启代理
:return:
"""
if Config.PROXY_ON:
asyncio.create_task(start_proxy(logger))
await start_mock()
# asyncio.create_task()


@lock("mitm_proxy")
async def start_mock():
asyncio.create_task(start_proxy(logger))


@pity.on_event('startup')
Expand Down

0 comments on commit a5d4f5b

Please sign in to comment.