Files
edward/task/material_distribution.py
konjacpotato 5267db8a0d
All checks were successful
Gitea Actions Demo / deploy (push) Successful in 15s
import edward
2025-11-12 21:19:26 +08:00

17 lines
541 B
Python

from database.database import get_session
from database.tmaterial.crud import receive_news
from database.tnews.crud import get_news_unprocessed, set_news_usage
from log.log_manager import log
from task.manager_task import execute_task
def distribution_task():
with get_session() as db:
news_list = get_news_unprocessed(db)
receive_news(db, news_list)
set_news_usage(db, news_list)
log(f'distributed {len(news_list)} news')
if __name__ == '__main__':
execute_task(distribution_task)