File tree 1 file changed +5
-5
lines changed
packages/service-library/src/servicelib
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 5
5
from pathlib import Path
6
6
from typing import Dict , Tuple
7
7
8
- import openapi_core
9
8
import yaml
9
+
10
+ import openapi_core
10
11
from aiohttp import ClientSession
11
- from openapi_core .schema .exceptions import \
12
- OpenAPIError # pylint: disable=W0611
13
- from openapi_core .schema .exceptions import OpenAPIMappingError
12
+ from openapi_core .schema .exceptions import OpenAPIError , OpenAPIMappingError # pylint: disable=W0611
14
13
from openapi_core .schema .specs .models import Spec
15
14
from yarl import URL
16
15
@@ -33,7 +32,8 @@ def load_from_path(filepath: Path) -> Tuple[Dict, str]:
33
32
34
33
35
34
async def load_from_url (url : URL ) -> Tuple [Dict , str ]:
36
- async with ClientSession () as session :
35
+ TIMEOUT_SECS = 5 * 60
36
+ async with ClientSession (timeout = TIMEOUT_SECS ) as session :
37
37
async with session .get (url ) as resp :
38
38
spec_dict = yaml .safe_load (resp .content )
39
39
return spec_dict , str (url )
You can’t perform that action at this time.
0 commit comments