Skip to content

Commit

Permalink
Change from aiohttp.get to aiohttp.ClientSession. (see aio-libs/aioht…
Browse files Browse the repository at this point in the history
  • Loading branch information
freiheit committed Feb 21, 2016
1 parent 9f441c0 commit 993b895
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion feed2discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
# Crazy workaround for a bug with parsing that doesn't apply on all pythons:
feedparser.PREFERRED_XML_PARSERS.remove('drv_libxml2')

httpclient = aiohttp.ClientSession()

conn = sqlite3.connect(db_path)

conn.execute('''CREATE TABLE IF NOT EXISTS feed_items
Expand Down Expand Up @@ -212,7 +214,7 @@ def background_check_feed(feed):
else:
logger.debug(feed+':no stored ETag')
logger.debug(feed+':sending http request for '+feed_url)
http_response = yield from aiohttp.request('GET', feed_url, headers=http_headers)
http_response = yield from httpclient.request('GET', feed_url, headers=http_headers)
logger.debug(http_response)
if http_response.status == 304:
logger.debug(feed+':data is old; moving on')
Expand Down

0 comments on commit 993b895

Please sign in to comment.