feat: add global RUST_ACCEL toggle to enable/disable rust acceleration at runtime

- Introduce RUST_ACCEL config to control all rust fast paths
- Fallback to Python implementations when disabled, preserving filter semantics
- Expose rust acceleration status in system info API
- Update CLI docs to reflect new toggle
- Add tests for runtime switch and fallback behavior
This commit is contained in:
jxxghp
2026-05-23 20:35:58 +08:00
parent 0bf228d29d
commit 0c133b7ccd
7 changed files with 151 additions and 17 deletions

View File

@@ -42,6 +42,7 @@ from app.schemas import ConfigChangeEventData
from app.schemas.types import SystemConfigKey, EventType
from app.utils.crypto import HashUtils
from app.utils.http import RequestUtils, AsyncRequestUtils
from app.utils import rust_accel
from app.utils.security import SecurityUtils
from app.utils.url import UrlUtils
from version import APP_VERSION
@@ -514,6 +515,7 @@ async def get_env_setting(_: User = Depends(get_current_active_user_async)):
"AUTH_VERSION": SitesHelper().auth_version,
"INDEXER_VERSION": SitesHelper().indexer_version,
"FRONTEND_VERSION": SystemChain().get_frontend_version(),
"RUST_ACCEL_ENABLED": rust_accel.is_enabled(),
}
)
return schemas.Response(success=True, data=info)