diff --git a/Makefile b/Makefile index 90fc56e..cd0799d 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,6 @@ debug: run: uv run -- dotenv run -- gunicorn -.PHONY: ingest -ingest: - uv run -- src/ingest.py +.PHONY: ingestor +ingestor: + uv run -- ingestor diff --git a/dist/ligoatingestor.service b/dist/ligoatingestor.service index 8c1ffe8..b4fa56c 100644 --- a/dist/ligoatingestor.service +++ b/dist/ligoatingestor.service @@ -3,7 +3,7 @@ Description = ligo.at jetstream ingestor After = ligoat.service [Service] -ExecStart = uv run -- src/ingest.py +ExecStart = uv run -- ingestor Type = simple Restart = always RestartSec = 5s diff --git a/src/ingest.py b/ingestor/__main__.py similarity index 95% rename from src/ingest.py rename to ingestor/__main__.py index 80c6cff..68bade1 100644 --- a/src/ingest.py +++ b/ingestor/__main__.py @@ -10,7 +10,8 @@ logger = logging.getLogger(__name__) async def ingest_jetstream(config: dict[str, str | None]): - socket = f"wss://{config['JETSTREAM_URL']}/subscribe" + base = config.get("JETSTREAM_URL", "jetstream1.us-east.bsky.network") + socket = f"wss://{base}/subscribe" socket += "?wantedCollections=at.ligo.*" logger.info(f"connecting to {socket}") async with aiohttp.ClientSession() as session: