update ttl to 15 minutes

This commit is contained in:
Artem Kharlamov 2016-03-04 10:36:35 +06:00
parent ce5867d9c7
commit 85a5afb2fd

View File

@ -23,7 +23,7 @@ TEMPLATE = Template('''
<channel>
<title>{{title}}</title>
<link>https://torrentapi.org/apidocs_v2.txt</link>
<ttl>3600</ttl>
<ttl>15</ttl>
{% for entry in entries %}
<item>
<title>{{entry.title}} ({{entry.hsize}})</title>
@ -85,8 +85,9 @@ async def api(params):
query_text = pretty(params)
secho('[{}] {}'.format(request_id, query_text), fg='cyan')
await update_token()
async with api_rate_limit:
await update_token()
params.update(token=app.token, format='json_extended')
resp = await get(API_ENDPOINT, params=params)
data = await resp.json()