Add server dbpurgeage warning state in API and mark task complete
This commit is contained in:
@@ -56,3 +56,7 @@ class ServerSettingsResponse(BaseModel):
|
||||
model_config = ConfigDict(strict=True)
|
||||
|
||||
settings: ServerSettings
|
||||
warnings: dict[str, bool] = Field(
|
||||
default_factory=dict,
|
||||
description="Warnings highlighting potentially unsafe settings.",
|
||||
)
|
||||
|
||||
@@ -160,8 +160,12 @@ async def get_settings(socket_path: str) -> ServerSettingsResponse:
|
||||
db_max_matches=db_max_matches,
|
||||
)
|
||||
|
||||
log.info("server_settings_fetched")
|
||||
return ServerSettingsResponse(settings=settings)
|
||||
warnings: dict[str, bool] = {
|
||||
"db_purge_age_too_low": db_purge_age < 86400,
|
||||
}
|
||||
|
||||
log.info("server_settings_fetched", db_purge_age=db_purge_age, warnings=warnings)
|
||||
return ServerSettingsResponse(settings=settings, warnings=warnings)
|
||||
|
||||
|
||||
async def update_settings(socket_path: str, update: ServerSettingsUpdate) -> None:
|
||||
|
||||
Reference in New Issue
Block a user