fix: settle puzzle failures and profile tasks
This commit is contained in:
@@ -167,6 +167,36 @@ impl SpacetimeClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn mark_puzzle_draft_generation_failed(
|
||||
&self,
|
||||
input: PuzzleDraftCompileFailureRecordInput,
|
||||
) -> Result<PuzzleAgentSessionRecord, SpacetimeClientError> {
|
||||
let procedure_input = PuzzleDraftCompileFailureInput {
|
||||
session_id: input.session_id,
|
||||
owner_user_id: input.owner_user_id,
|
||||
error_message: input.error_message,
|
||||
failed_at_micros: input.failed_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(
|
||||
"mark_puzzle_draft_generation_failed",
|
||||
move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.mark_puzzle_draft_generation_failed_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_puzzle_agent_session_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
},
|
||||
);
|
||||
},
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn save_puzzle_generated_images(
|
||||
&self,
|
||||
input: PuzzleGeneratedImagesSaveRecordInput,
|
||||
|
||||
Reference in New Issue
Block a user