Add stream flag to avoid Memory Error

If not add stream flag, large file will be total load into memory, which cause MemoryError on small RAM server.
This commit is contained in:
Coder4 2019-02-15 17:40:29 +08:00 committed by GitHub
parent b63c004c32
commit b8f178ba25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,6 @@ def do_get(url, access_token):
'Accept': 'application/json',
'Authorization': 'Bearer {0}'.format(access_token)}
response = requests.get(url, params=None, headers=bearer_headers)
response = requests.get(url, params=None, headers=bearer_headers, stream=True)
return response