Initial commit - cleaned repository
This commit is contained in:
37
services/pipeline/check_keywords.py
Normal file
37
services/pipeline/check_keywords.py
Normal file
@ -0,0 +1,37 @@
|
||||
#!/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())
|
||||
Reference in New Issue
Block a user