fix: _publish_next 중복 정의 제거 — pending 이동 안 되던 근본 원인
upstream의 drafts/ 기반 _publish_next(520줄)가 수정된 originals→pending 버전(257줄)을 덮어쓰고 있었음. Python은 마지막 정의를 사용하므로 originals/에서 pending_review/로 이동이 전혀 안 되던 것. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -517,27 +517,7 @@ def _load_article_by_slug(date_str: str, slug: str) -> dict:
|
|||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
def _publish_next():
|
## _publish_next는 257번 줄에 정의됨 (originals → pending_review 이동)
|
||||||
drafts_dir = DATA_DIR / 'drafts'
|
|
||||||
drafts_dir.mkdir(exist_ok=True)
|
|
||||||
for draft_file in sorted(drafts_dir.glob('*.json')):
|
|
||||||
try:
|
|
||||||
article = json.loads(draft_file.read_text(encoding='utf-8'))
|
|
||||||
if article.get('_pending_openclaw'):
|
|
||||||
continue
|
|
||||||
sys.path.insert(0, str(BASE_DIR / 'bots'))
|
|
||||||
sys.path.insert(0, str(BASE_DIR / 'bots' / 'converters'))
|
|
||||||
import publisher_bot
|
|
||||||
import blog_converter
|
|
||||||
# 변환봇으로 HTML 생성 (이미 변환된 경우 outputs에서 읽음)
|
|
||||||
html = blog_converter.convert(article, save_file=False)
|
|
||||||
article['_html_content'] = html
|
|
||||||
article['_body_is_html'] = True
|
|
||||||
publisher_bot.publish(article)
|
|
||||||
draft_file.unlink(missing_ok=True)
|
|
||||||
break
|
|
||||||
except Exception as e:
|
|
||||||
logger.error(f"드래프트 처리 오류 ({draft_file.name}): {e}")
|
|
||||||
|
|
||||||
|
|
||||||
def job_analytics_daily():
|
def job_analytics_daily():
|
||||||
|
|||||||
Reference in New Issue
Block a user