fix: allow empty CRAWL_LIMIT env value
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from functools import lru_cache
|
||||
from pydantic import Field
|
||||
from pydantic import Field, field_validator
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
@@ -19,6 +19,13 @@ class Settings(BaseSettings):
|
||||
session_secret: str = Field(default="dev-session-secret", min_length=8)
|
||||
mcp_token: str = "dev-mcp-token"
|
||||
|
||||
@field_validator("crawl_limit", mode="before")
|
||||
@classmethod
|
||||
def empty_crawl_limit_as_none(cls, value):
|
||||
if value == "":
|
||||
return None
|
||||
return value
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
APP_VERSION = "0.2.6"
|
||||
FRONTEND_VERSION = "0.2.6"
|
||||
BACKEND_VERSION = "0.2.6"
|
||||
APP_VERSION = "0.2.7"
|
||||
FRONTEND_VERSION = "0.2.7"
|
||||
BACKEND_VERSION = "0.2.7"
|
||||
|
||||
Reference in New Issue
Block a user