mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 17:01:34 +00:00
parent
fcd9752f19
commit
9d0ae2f95b
1 changed files with 4 additions and 3 deletions
|
@ -30,11 +30,11 @@ import traceback
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
from typing import Dict, Optional, Tuple
|
from typing import Dict, Optional, Tuple
|
||||||
import aiohttp
|
|
||||||
from aiohttp import web
|
|
||||||
from base64 import b64decode
|
from base64 import b64decode
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
|
import aiohttp
|
||||||
|
from aiohttp import web, client_exceptions
|
||||||
import jsonrpcclient
|
import jsonrpcclient
|
||||||
import jsonrpcserver
|
import jsonrpcserver
|
||||||
from jsonrpcserver import response
|
from jsonrpcserver import response
|
||||||
|
@ -54,6 +54,7 @@ from .logging import get_logger, Logger
|
||||||
|
|
||||||
_logger = get_logger(__name__)
|
_logger = get_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DaemonNotRunning(Exception):
|
class DaemonNotRunning(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -100,7 +101,7 @@ def request(config: SimpleConfig, endpoint, args=(), timeout=60):
|
||||||
auth = aiohttp.BasicAuth(login=rpc_user, password=rpc_password)
|
auth = aiohttp.BasicAuth(login=rpc_user, password=rpc_password)
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
async def request_coroutine():
|
async def request_coroutine():
|
||||||
async with aiohttp.ClientSession(auth=auth, loop=loop) as session:
|
async with aiohttp.ClientSession(auth=auth) as session:
|
||||||
server = AiohttpClient(session, server_url)
|
server = AiohttpClient(session, server_url)
|
||||||
f = getattr(server, endpoint)
|
f = getattr(server, endpoint)
|
||||||
response = await f(*args)
|
response = await f(*args)
|
||||||
|
|
Loading…
Add table
Reference in a new issue