Skip to content

Commit

Permalink
Made analytics requests async
Browse files Browse the repository at this point in the history
Closes #1
  • Loading branch information
revolter committed Aug 16, 2018
1 parent 24910ac commit 61c4e82
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging

from botanio import botan
from telegram.ext.dispatcher import run_async

import requests
import requests_cache
Expand Down Expand Up @@ -53,6 +54,7 @@ def __google_track(self, analytics_type, user, data):
if response.status_code != 200:
logger.error('Google analytics error: {}'.format(response.status_code))

@run_async
def track(self, analytics_type, user, data):
self.__botan_track(analytics_type, user, data)
self.__google_track(analytics_type, user, data)

0 comments on commit 61c4e82

Please sign in to comment.