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:
parent
b63c004c32
commit
b8f178ba25
|
@ -6,6 +6,6 @@ def do_get(url, access_token):
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': 'Bearer {0}'.format(access_token)}
|
'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
|
return response
|
||||||
|
|
Loading…
Reference in a new issue