forked from 1b-agent/opencadstudio-upstream
refactor(plugin): share timeout helpers between process and process::v4
Delete the 5 copy-pasted timeout helpers in process/v4.rs (CALL_TIMEOUT_DEFAULT, call_timeout, request_timeout, execute_code_timeout, base_max_floor, request_kind) and reuse the canonical process.rs versions, now pub(crate). Prevents floor drift between v1 and v4 paths. Net: +3 / -59, no behavior change. Verified: cargo check -p ocs_plugin_api clean, cargo test -p ocs_plugin_api --lib --features host (92 passed).
This commit is contained in:
1 parent
b7de6a3287
commit
1bc20b9ecc
2 files changed
+3
-59
No files matched your search
@@ -193,7 +193,7 @@ fn call_timeout() -> Duration {
|
||||
|
||||
/// Per-request-kind timeout floors. The user-configured default is raised to
|
||||
/// these minima so that no request kind can be configured into an unsafe value.
|
||||
fn request_timeout(kind: &'static str) -> Duration {
|
||||
pub(crate) fn request_timeout(kind: &'static str) -> Duration {
|
||||
base_max_floor(call_timeout(), kind)
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ fn base_max_floor(base: Duration, kind: &'static str) -> Duration {
|
||||
base.max(floor)
|
||||
}
|
||||
|
||||
fn request_kind(req: &HostRequest) -> &'static str {
|
||||
pub(crate) fn request_kind(req: &HostRequest) -> &'static str {
|
||||
match req {
|
||||
HostRequest::GetManifest => "GetManifest",
|
||||
HostRequest::GetRibbon => "GetRibbon",
|
||||
|
||||
Reference in new issue
Block a user