diff --git a/scripts/backfill_post_keymen.py b/scripts/backfill_post_keymen.py index 5a4618c48..59e2efd6c 100644 --- a/scripts/backfill_post_keymen.py +++ b/scripts/backfill_post_keymen.py @@ -11,10 +11,16 @@ import asyncio import json import os +import sys from collections import Counter +from pathlib import Path import asyncpg +REPOSITORY_ROOT = Path(__file__).resolve().parents[1] +if str(REPOSITORY_ROOT) not in sys.path: + sys.path.insert(0, str(REPOSITORY_ROOT)) + from backend.app.config import load_settings from backend.app.keyman_ingestion import ingest_post_keymen from backend.app.main import ( diff --git a/scripts/requeue_failed_post_content.py b/scripts/requeue_failed_post_content.py index 3e3e84da4..6747524f8 100644 --- a/scripts/requeue_failed_post_content.py +++ b/scripts/requeue_failed_post_content.py @@ -4,10 +4,16 @@ import argparse import asyncio +import sys +from pathlib import Path import asyncpg import redis.asyncio as redis +REPOSITORY_ROOT = Path(__file__).resolve().parents[1] +if str(REPOSITORY_ROOT) not in sys.path: + sys.path.insert(0, str(REPOSITORY_ROOT)) + from backend.app.config import load_settings from backend.app.post_content_queue import ( publish_post_content_event,