From 7f203bf9005a5b73d2d6980b2bdf93a239d48559 Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 28 Jan 2024 16:33:45 +0300 Subject: [PATCH] deps-fix --- pyproject.toml | 3 +-- services/viewed.py | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 90c5f1c1..90a3d3bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,10 +16,9 @@ starlette = "^0.36.1" gql = "^3.4.1" ariadne = "^0.21" aiohttp = "^3.9.1" -google-oauth2-tool = "^0.0.3" -google-api-python-client = "^2.114.0" pre-commit = "^3.6.0" granian = "^1.0.1" +google-analytics-data = "^0.18.3" [tool.poetry.group.dev.dependencies] setuptools = "^69.0.2" diff --git a/services/viewed.py b/services/viewed.py index 523b340b..4e11e48f 100644 --- a/services/viewed.py +++ b/services/viewed.py @@ -36,7 +36,7 @@ class ViewedStorage: analytics_client: BetaAnalyticsDataClient | None = None auth_result = None disabled = False - updated = int(time.time()) + start_date = int(time.time()) @staticmethod async def init(): @@ -55,7 +55,8 @@ class ViewedStorage: self.load_precounted_views() if os.path.exists(VIEWS_FILEPATH): - self.updated = os.path.getctime(VIEWS_FILEPATH) + file_timestamp = os.path.getctime(VIEWS_FILEPATH) + self.start_date = datetime.fromtimestamp(file_timestamp).strftime('%Y-%m-%d') # Запуск фоновой задачи asyncio.create_task(self.worker())