Skip to content

Commit

Permalink
Update messages.py (littlecodersh#724)
Browse files Browse the repository at this point in the history
Add timeout for upload file function to fix large file send error
  • Loading branch information
Big2Cat authored and chyroc committed Sep 2, 2018
1 parent 1306749 commit dd23b5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion itchat/components/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def upload_chunk_file(core, fileDir, fileSymbol, fileSize,
else:
files['chunk'], files['chunks'] = (None, str(chunk)), (None, str(chunks))
headers = { 'User-Agent' : config.USER_AGENT }
return core.s.post(url, files=files, headers=headers)
return core.s.post(url, files=files, headers=headers, timeout=config.TIMEOUT)

def send_file(self, fileDir, toUserName=None, mediaId=None, file_=None):
logger.debug('Request to send a file(mediaId: %s) to %s: %s' % (
Expand Down

0 comments on commit dd23b5e

Please sign in to comment.