Merge pull request 'dev' (#81) from dev into master

Reviewed-on: freeleaps/freeleaps-service-hub#81
This commit is contained in:
icecheng 2025-09-30 05:52:43 +00:00
commit a1155051b5
3 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,4 @@
from pydantic_settings import BaseSettings from pydantic_settings import BaseSettings
from typing import Optional
class AppSettings(BaseSettings): class AppSettings(BaseSettings):
@ -20,6 +19,7 @@ class AppSettings(BaseSettings):
STARROCKS_USER: str = "root" STARROCKS_USER: str = "root"
STARROCKS_PASSWORD: str = "" STARROCKS_PASSWORD: str = ""
STARROCKS_DATABASE: str = "freeleaps" STARROCKS_DATABASE: str = "freeleaps"
STARROCKS_POOL_RECYCLE: int = 300
# Prometheus settings # Prometheus settings
PROMETHEUS_ENDPOINT: str = "http://kube-prometheus-stack-prometheus.freeleaps-monitoring-system:9090" PROMETHEUS_ENDPOINT: str = "http://kube-prometheus-stack-prometheus.freeleaps-monitoring-system:9090"

View File

@ -11,7 +11,7 @@ class SiteSettings(BaseSettings):
ENV: str = "dev" ENV: str = "dev"
SERVER_HOST: str = "localhost" SERVER_HOST: str = "localhost"
SERVER_PORT: int = 9000 SERVER_PORT: int = 8009
URL: str = "http://localhost" URL: str = "http://localhost"
TIME_ZONE: str = "UTC" TIME_ZONE: str = "UTC"

View File

@ -25,8 +25,9 @@ class DatabaseConnectionPool:
charset='utf8mb4', charset='utf8mb4',
autocommit=True, autocommit=True,
minsize=5, # Minimum number of connections in the pool minsize=5, # Minimum number of connections in the pool
maxsize=20, # Maximum number of connections in the pool maxsize=10, # Maximum number of connections in the pool
pool_recycle=3600, # Recycle connections after 1 hour pool_recycle=app_settings.STARROCKS_POOL_RECYCLE, # Recycle connections after 0.5 hours
connect_timeout=30, # Connection timeout in seconds
echo=False # Set to True for SQL query logging echo=False # Set to True for SQL query logging
) )
await self.module_logger.log_info( await self.module_logger.log_info(