porridger/back/scheduler.py

15 lines
384 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('minutely')
async def daily_check():
# Фильтруем по сроку годности
add_poems_and_filters.check_obsolete(database, current_date=datetime.date.today())