- Add multi-threaded keyword scheduler for periodic news collection - Create Keyword Manager API for CRUD operations and monitoring - Implement automatic pipeline triggering (RSS → Google → AI → Translation) - Add thread status monitoring and dynamic keyword management - Support priority-based execution and configurable intervals - Add comprehensive scheduler documentation guide - Default keywords: AI, 테크놀로지, 경제, 블록체인 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
"""키워드 데이터베이스 확인 스크립트"""
|
|
import asyncio
|
|
from motor.motor_asyncio import AsyncIOMotorClient
|
|
from datetime import datetime
|
|
|
|
async def check_keywords():
|
|
client = AsyncIOMotorClient("mongodb://localhost:27017")
|
|
db = client.ai_writer_db
|
|
|
|
# 키워드 조회
|
|
keywords = await db.keywords.find().to_list(None)
|
|
|
|
print(f"\n=== 등록된 키워드: {len(keywords)}개 ===\n")
|
|
|
|
for kw in keywords:
|
|
print(f"키워드: {kw['keyword']}")
|
|
print(f" - ID: {kw['keyword_id']}")
|
|
print(f" - 간격: {kw['interval_minutes']}분")
|
|
print(f" - 활성화: {kw['is_active']}")
|
|
print(f" - 우선순위: {kw['priority']}")
|
|
print(f" - RSS 피드: {len(kw.get('rss_feeds', []))}개")
|
|
|
|
if kw.get('last_run'):
|
|
print(f" - 마지막 실행: {kw['last_run']}")
|
|
|
|
if kw.get('next_run'):
|
|
next_run = kw['next_run']
|
|
remaining = (next_run - datetime.now()).total_seconds() / 60
|
|
print(f" - 다음 실행: {next_run} ({remaining:.1f}분 후)")
|
|
|
|
print()
|
|
|
|
client.close()
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(check_keywords()) |