Skip to content

Commit

Permalink
Fix bug related with the lack of waiting for a response from athenapdf.
Browse files Browse the repository at this point in the history
  • Loading branch information
Djapy committed Mar 26, 2019
1 parent d3aa3be commit 9d7e896
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions delivery_pdf/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ async def fetch_pdf(self, uuid):
url = 'http://{}:{}/convert'.format(host_service, port_service)
url_server = 'http://{}:{}/raw/{}'.format(host_server, port_server, uuid)
params = {'auth': 'arachnys-weaver', 'url': url_server}
timeout = ClientTimeout(total=5*60, connect=2*60, sock_connect=60, sock_read=60)
timeout = ClientTimeout(total=6*60, connect=2*60, sock_connect=60, sock_read=60)
async with ClientSession(timeout=timeout) as session:
async with session.get(url=url, params=params) as resp:
return resp.content
content = await resp.content.read()
return content

async def convert_html(self, request):
if request.method == 'POST':
Expand Down

0 comments on commit 9d7e896

Please sign in to comment.