Increasing archive response timeout.

This commit is contained in:
Roland 2021-11-12 12:38:54 -07:00
parent 75169462e3
commit 9a94de0314
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 10 additions and 0 deletions

View file

@ -22,7 +22,14 @@ formatter = logging.Formatter('[%(asctime)s] [%(name)s] [%(levelname)s] %(messag
ch.setFormatter(formatter)
logger.addHandler(ch)
# Increase response timeout, archiving can take several minutes.
RESPONSE_TIMEOUT = 10 * 60
config = {
'RESPONSE_TIMEOUT': RESPONSE_TIMEOUT,
}
app = Sanic('archive')
app.update_config(config)
index_html = '''
<html>

View file

@ -92,6 +92,9 @@ def request_archive(url: str):
except Exception as e:
logger.error('Error when requesting archive', exc_info=e)
raise
logger.debug(f'archive request status {resp.status_code=}')
readability = resp.json()['readability']
# Compressed base64
singlefile = resp.json()['singlefile']