27 lines
971 B
Python
27 lines
971 B
Python
"""이미 만든 그날 포스트에 캐릭터 댓글을 단다 (기능을 넣은 날 한 번). 이미 달린 포스트는 건너뛴다.
|
|
python scripts/fill_bot_comments.py 2026-10-27"""
|
|
import asyncio
|
|
import os
|
|
import sys
|
|
from datetime import date
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
from common.database.db_session_manager import DB_SESSION_MNG # noqa: E402
|
|
from common.enums import ErrorType # noqa: E402
|
|
from crud.feed_crud import FeedCRUD # noqa: E402
|
|
from services.bot_comment import fill_bot_comments # noqa: E402
|
|
from services.feed_service import clear_feed_cache # noqa: E402
|
|
|
|
|
|
async def main(day: date) -> int:
|
|
err = await fill_bot_comments(day, FeedCRUD())
|
|
await clear_feed_cache()
|
|
await DB_SESSION_MNG.stop()
|
|
print(f"bot comments {day}: {err.name}")
|
|
return 0 if err is ErrorType.SUCCESS else 1
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(asyncio.run(main(date.fromisoformat(sys.argv[1]))))
|