Skip to content

Commit

Permalink
fix(host): ignore no id found error for cancellation (#330)
Browse files Browse the repository at this point in the history
* fix(host): ignore `no id found` error for cancellation

* fix(host): add proof object to spec

* refactor(host): simplify cancel proof handling
  • Loading branch information
petarvujovic98 authored Jul 29, 2024
1 parent 1f0b062 commit 048df9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion host/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ impl ProofActor {
(key.chain_id, key.blockhash, key.proof_system as u8),
Box::new(&mut manager),
)
.await?;
.await
.or_else(|e| {
if e.to_string().contains("no id found") {
warn!("Task already cancelled or not yet started!");
Ok(())
} else {
Err::<(), HostError>(e.into())
}
})?;
task.cancel();
Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions host/src/server/api/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ mod proof;
TaskStatus,
CancelStatus,
PruneStatus,
Proof,
Status,
)
),
Expand Down

0 comments on commit 048df9f

Please sign in to comment.