Refactored ingestion to semaphore-bounded tasks, centralized error handling, and consolidated metrics.
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 5s
CI / Tests (push) Successful in 22s
CI / Type Checking (push) Successful in 11s
CI / Spelling (push) Successful in 5s

This commit is contained in:
2026-03-22 22:45:31 -04:00
parent c1f967ece9
commit 093426ac61
7 changed files with 180 additions and 135 deletions
-21
View File
@@ -80,26 +80,6 @@ def _parse_args(argv: list[str] | None = None) -> argparse.Namespace:
' variable or "crabstero.db").'
),
)
workers_env = os.environ.get("INGESTION_WORKERS", "4")
try:
workers_default = int(workers_env)
except ValueError:
logger.warning(
"Invalid INGESTION_WORKERS value '%s', defaulting to 4.",
workers_env,
)
workers_default = 4
parser.add_argument(
"--ingestion-workers",
type=int,
default=workers_default,
help=(
"Number of concurrent ingestion workers"
" (default: INGESTION_WORKERS environment"
" variable or 4)."
),
)
parser.add_argument(
"--ingest-only",
action="store_true",
@@ -157,7 +137,6 @@ def main() -> None:
bot = Crabstero(
token=args.token,
database_path=args.database_path,
ingestion_workers=args.ingestion_workers,
ingest_only=args.ingest_only,
metrics_address=args.listen_metrics,
)