扩展外部生成Worker队列

新增外部生成队列概览和单任务状态契约

将跳一跳、拼消消、敲木鱼图片生成动作接入worker队列

前端生成等待页展示当前任务和队列数量

更新外部生成worker运维文档和团队决策记录
This commit is contained in:
2026-06-12 23:15:55 +08:00
parent 3bccfd1a83
commit 951caac32d
43 changed files with 1913 additions and 67 deletions

View File

@@ -66,6 +66,15 @@ impl From<ExternalGenerationJobFailRecordInput> for ExternalGenerationJobFailInp
}
}
impl From<ExternalGenerationJobGetRecordInput> for ExternalGenerationJobGetInput {
fn from(input: ExternalGenerationJobGetRecordInput) -> Self {
Self {
job_id: input.job_id,
owner_user_id: input.owner_user_id,
}
}
}
pub(crate) fn map_external_generation_job_procedure_result(
result: ExternalGenerationJobProcedureResult,
) -> Result<ExternalGenerationJobRecord, SpacetimeClientError> {
@@ -144,6 +153,7 @@ fn map_external_generation_job_snapshot(
started_at: snapshot.started_at_micros.map(format_timestamp_micros),
completed_at: snapshot.completed_at_micros.map(format_timestamp_micros),
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
updated_at_micros: snapshot.updated_at_micros,
lease_token: snapshot.lease_token,
}
}
@@ -199,6 +209,12 @@ pub struct ExternalGenerationJobFailRecordInput {
pub failed_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExternalGenerationJobGetRecordInput {
pub job_id: String,
pub owner_user_id: String,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExternalGenerationJobRecord {
pub job_id: String,
@@ -221,6 +237,7 @@ pub struct ExternalGenerationJobRecord {
pub started_at: Option<String>,
pub completed_at: Option<String>,
pub updated_at: String,
pub updated_at_micros: i64,
pub lease_token: Option<String>,
}