File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 12
12
UCLOUD_DOWNLOAD_SUFFIX = '.cn-bj.ufileos.com'
13
13
UCLOUD_API_URL = 'http://api.ucloud.cn'
14
14
BLOCKSIZE = 1024 * 1024 * 4
15
+ CONNECTION_POOL_SIZE = 10
15
16
16
17
_config = {
17
18
'connection_timeout' : None ,
Original file line number Diff line number Diff line change 2
2
3
3
import re
4
4
5
- import requests
5
+ from requests import Session , RequestException
6
+ from requests .adapters import HTTPAdapter
6
7
7
8
from . import config
8
9
from .logger import logger
9
10
11
+ requests = Session ()
12
+ requests .mount ("http://" ,
13
+ HTTPAdapter (pool_connections = config .CONNECTION_POOL_SIZE , pool_maxsize = config .CONNECTION_POOL_SIZE ))
14
+ requests .mount ("https://" ,
15
+ HTTPAdapter (pool_connections = config .CONNECTION_POOL_SIZE , pool_maxsize = config .CONNECTION_POOL_SIZE ))
16
+
10
17
11
18
def __return_wraper (response , content_consumed = False ):
12
19
"""
You can’t perform that action at this time.
0 commit comments