From 61c4e8221e5898eed2a8288a61222888ea8fa9b3 Mon Sep 17 00:00:00 2001 From: Iulian Onofrei Date: Fri, 17 Aug 2018 01:22:50 +0300 Subject: [PATCH] Made analytics requests async Closes #1 --- src/analytics.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/analytics.py b/src/analytics.py index f389867..0f30b4f 100644 --- a/src/analytics.py +++ b/src/analytics.py @@ -5,6 +5,7 @@ import logging from botanio import botan +from telegram.ext.dispatcher import run_async import requests import requests_cache @@ -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)