porridger/back/scheduler.py
2023-08-23 23:46:51 +03:00

15 lines
381 B
Python

from . import add_poems_and_filters
from rocketry import Rocketry
from rocketry.conds import daily
import datetime
from .db import database
app = Rocketry(execution="async")
# Create task:
@app.task('daily')
async def daily_check():
# Фильтруем по сроку годности
add_poems_and_filters.check_obsolete(database, current_date=datetime.date.today())