viwed-fix+fmt+outerjoin-fix
All checks were successful
Deploy on push / deploy (push) Successful in 1m1s

This commit is contained in:
2024-04-27 01:41:47 +03:00
parent 89956d6240
commit 2e4d70db28
9 changed files with 43 additions and 31 deletions

View File

@@ -9,11 +9,13 @@ from sqlalchemy import JSON, Column, Engine, Integer, create_engine, event, exc,
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session, configure_mappers
from sqlalchemy.sql.schema import Table
from sqlalchemy_searchable import make_searchable
from services.logger import root_logger as logger
from settings import DB_URL
# from sqlalchemy_searchable import make_searchable
# Подключение к базе данных SQLAlchemy
engine = create_engine(DB_URL, echo=False, pool_size=10, max_overflow=20)
inspector = inspect(engine)
@@ -69,7 +71,7 @@ class Base(declarative_base()):
setattr(self, key, value)
make_searchable(Base.metadata)
# make_searchable(Base.metadata)
Base.metadata.create_all(bind=engine)

View File

@@ -7,7 +7,12 @@ from typing import Dict
# ga
from google.analytics.data_v1beta import BetaAnalyticsDataClient
from google.analytics.data_v1beta.types import DateRange, Dimension, Metric, RunReportRequest
from google.analytics.data_v1beta.types import (
DateRange,
Dimension,
Metric,
RunReportRequest,
)
from orm.author import Author
from orm.shout import Shout, ShoutAuthor, ShoutTopic
@@ -59,10 +64,9 @@ class ViewedStorage:
self = ViewedStorage
try:
if os.path.exists(VIEWS_FILEPATH):
self.file_modification_timestamp = os.path.getmtime(VIEWS_FILEPATH)
self.start_date = datetime.fromtimestamp(
self.file_modification_timestamp
).strftime("%Y-%m-%d")
start_date_int = os.path.getmtime(VIEWS_FILEPATH)
start_date_str = datetime.fromtimestamp(start_date_int).strftime('%Y-%m-%d')
self.start_date = start_date_str
now_date = datetime.now().strftime("%Y-%m-%d")
if now_date == self.start_date: