Fix #1686: Use dynamic version from crawl4ai package in health endpoint

Replace hardcoded version string with import from crawl4ai.__version__
to ensure health endpoint reports correct version.

Fixes #1686
Reviewers: @chansearrington
This commit is contained in:
José
2026-01-20 23:40:38 +01:00
parent f6f7f1b551
commit fe1c1cb0bc

View File

@@ -9,6 +9,7 @@ Crawl4AI FastAPI entrypoint
# ── stdlib & 3rdparty imports ───────────────────────────────
from crawler_pool import get_crawler, close_all, janitor
from crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig
from crawl4ai import __version__
from auth import create_access_token, get_token_dependency, TokenRequest
from pydantic import BaseModel
from typing import Optional, List, Dict
@@ -73,7 +74,7 @@ sys.path.append(os.path.dirname(os.path.realpath(__file__)))
config = load_config()
setup_logging(config)
__version__ = "0.5.1-d1"
# Version is imported from crawl4ai package to ensure it stays in sync
# ── global page semaphore (hard cap) ─────────────────────────
MAX_PAGES = config["crawler"]["pool"].get("max_pages", 30)