Skip to content

Commit

Permalink
Merge pull request #554 from leancloud/fix-conn-reset
Browse files Browse the repository at this point in the history
fix connection reset error
  • Loading branch information
juvenn authored Jun 19, 2024
2 parents 84cac98 + 44f4c45 commit 2896a12
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ six = ">=1.11.0"
qiniu = ">=7.1.4,<7.2.4"
"urllib3" = ">=1.24.3,<=1.25.3"
requests = ">=2.20.0,<=2.22.0"
requests-toolbelt = ">=1.0.0"
Werkzeug = ">=0.11.11,<1.0.0"
gevent = ">=22.10.2,<23.0.0"
typing = { version = "*", markers = "python_version < '3.5.0'" }
Expand Down
3 changes: 3 additions & 0 deletions leancloud/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import six
import requests
from requests_toolbelt.adapters.socket_options import TCPKeepAliveAdapter

import leancloud
from leancloud import utils
Expand Down Expand Up @@ -43,6 +44,8 @@

app_router = None
session = requests.Session()
session.mount("http://", TCPKeepAliveAdapter())
session.mount("https://", TCPKeepAliveAdapter())
request_hooks = {}

SERVER_VERSION = "1.1"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ iso8601>=0.1.14
six>=1.11.0
qiniu>=7.3.1
requests>=2.25.1
requests-toolbelt>=1.0.0
urllib3<2
Werkzeug>=0.16.0,<2.0.0
secure-cookie>=0.1.0,<1.0.0
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'six>=1.11.0',
'qiniu==7.3.1',
'requests>=2.25.1',
'requests-toolbelt>=1.0.0',
'Werkzeug>=0.16.0,<2.0.0',
'secure-cookie>=0.1.0,<1.0.0',
'gevent>=22.10.2,<23.0.0',
Expand Down

0 comments on commit 2896a12

Please sign in to comment.