forked from retoor/devplacepy
feat: add per-user customization suppression toggles and API endpoints for profile
This commit is contained in:
+2
-8
@@ -36,19 +36,13 @@ os.environ["DEVPLACE_SITEMAP_TTL"] = "0"
|
||||
|
||||
|
||||
def run_async(coro):
|
||||
"""Run a coroutine from synchronous test code, regardless of event loop state."""
|
||||
try:
|
||||
loop = asyncio.get_running_loop()
|
||||
except RuntimeError:
|
||||
return asyncio.run(coro)
|
||||
|
||||
"""Run a coroutine from sync test code on a dedicated thread and fresh loop."""
|
||||
result_box = []
|
||||
exc_box = []
|
||||
|
||||
def _run():
|
||||
try:
|
||||
future = asyncio.run_coroutine_threadsafe(coro, loop)
|
||||
result_box.append(future.result())
|
||||
result_box.append(asyncio.run(coro))
|
||||
except BaseException as e:
|
||||
exc_box.append(e)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user