refactor: 抽离 AI pipeline 与调度共享能力逻辑

This commit is contained in:
fawney19
2026-04-10 01:46:14 +08:00
parent b901a6ffc7
commit 5014e2f5fd
255 changed files with 15057 additions and 3115 deletions
@@ -503,6 +503,8 @@ pub(super) fn sample_request_candidate(
created_at_unix_secs: i64,
finished_at_unix_secs: Option<i64>,
) -> StoredRequestCandidate {
let created_at_unix_ms = created_at_unix_secs * 1_000;
let finished_at_unix_ms = finished_at_unix_secs.map(|v| v * 1_000);
StoredRequestCandidate::new(
id.to_string(),
request_id.to_string(),
@@ -525,9 +527,9 @@ pub(super) fn sample_request_candidate(
Some(1),
None,
None,
created_at_unix_secs,
Some(created_at_unix_secs),
finished_at_unix_secs,
created_at_unix_ms,
Some(created_at_unix_ms),
finished_at_unix_ms,
)
.expect("request candidate should build")
}
@@ -562,9 +564,9 @@ pub(super) fn sample_recent_key_rpm_candidate(
Some(concurrent_requests),
None,
None,
now_unix_secs - 10,
Some(now_unix_secs - 10),
Some(now_unix_secs - 8),
(now_unix_secs - 10) * 1_000,
Some((now_unix_secs - 10) * 1_000),
Some((now_unix_secs - 8) * 1_000),
)
.expect("request candidate should build")
}