mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 15:06:19 -05:00
Increasing archive response timeout.
This commit is contained in:
parent
75169462e3
commit
9a94de0314
2 changed files with 10 additions and 0 deletions
|
|
@ -22,7 +22,14 @@ formatter = logging.Formatter('[%(asctime)s] [%(name)s] [%(levelname)s] %(messag
|
||||||
ch.setFormatter(formatter)
|
ch.setFormatter(formatter)
|
||||||
logger.addHandler(ch)
|
logger.addHandler(ch)
|
||||||
|
|
||||||
|
# Increase response timeout, archiving can take several minutes.
|
||||||
|
RESPONSE_TIMEOUT = 10 * 60
|
||||||
|
config = {
|
||||||
|
'RESPONSE_TIMEOUT': RESPONSE_TIMEOUT,
|
||||||
|
}
|
||||||
|
|
||||||
app = Sanic('archive')
|
app = Sanic('archive')
|
||||||
|
app.update_config(config)
|
||||||
|
|
||||||
index_html = '''
|
index_html = '''
|
||||||
<html>
|
<html>
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,9 @@ def request_archive(url: str):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error('Error when requesting archive', exc_info=e)
|
logger.error('Error when requesting archive', exc_info=e)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
logger.debug(f'archive request status {resp.status_code=}')
|
||||||
|
|
||||||
readability = resp.json()['readability']
|
readability = resp.json()['readability']
|
||||||
# Compressed base64
|
# Compressed base64
|
||||||
singlefile = resp.json()['singlefile']
|
singlefile = resp.json()['singlefile']
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue