inner-search-2
All checks were successful
Deploy to core / deploy (push) Successful in 1m36s

This commit is contained in:
2024-01-29 04:09:54 +03:00
parent 2c2932caeb
commit 8ff1949170
3 changed files with 34 additions and 36 deletions

View File

@@ -61,6 +61,12 @@ class ViewedStorage:
if os.path.exists(VIEWS_FILEPATH):
file_timestamp = os.path.getctime(VIEWS_FILEPATH)
self.start_date = datetime.fromtimestamp(file_timestamp).strftime('%Y-%m-%d')
now_date = datetime.now().strftime('%Y-%m-%d')
if now_date == self.start_date:
logger.info(' * Данные актуализованы!')
else:
logger.info(f' * Миграция проводилась: {self.start_date}')
# Запуск фоновой задачи
asyncio.create_task(self.worker())