Skip to content

Commit dd23b5e

Browse files
Big2Catchyroc
authored andcommitted
Update messages.py (#724)
Add timeout for upload file function to fix large file send error
1 parent 1306749 commit dd23b5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

itchat/components/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def upload_chunk_file(core, fileDir, fileSymbol, fileSize,
364364
else:
365365
files['chunk'], files['chunks'] = (None, str(chunk)), (None, str(chunks))
366366
headers = { 'User-Agent' : config.USER_AGENT }
367-
return core.s.post(url, files=files, headers=headers)
367+
return core.s.post(url, files=files, headers=headers, timeout=config.TIMEOUT)
368368

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

0 commit comments

Comments
 (0)