|
@@ -399,28 +399,29 @@ impl Mint {
|
|
|
.await
|
|
.await
|
|
|
{
|
|
{
|
|
|
tracing::error!(
|
|
tracing::error!(
|
|
|
- "Failed to finalize internal settlement saga {}: {}",
|
|
|
|
|
|
|
+ "Failed to finalize internal settlement saga {}: {}. Will retry on next recovery cycle.",
|
|
|
saga.operation_id,
|
|
saga.operation_id,
|
|
|
err
|
|
err
|
|
|
);
|
|
);
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Delete saga after successful finalization
|
|
// Delete saga after successful finalization
|
|
|
let mut tx = self.localstore.begin_transaction().await?;
|
|
let mut tx = self.localstore.begin_transaction().await?;
|
|
|
if let Err(e) = tx.delete_saga(&saga.operation_id).await {
|
|
if let Err(e) = tx.delete_saga(&saga.operation_id).await {
|
|
|
tracing::error!(
|
|
tracing::error!(
|
|
|
- "Failed to delete saga for {}: {}",
|
|
|
|
|
|
|
+ "Failed to delete saga {}: {}. Will retry on next recovery cycle.",
|
|
|
saga.operation_id,
|
|
saga.operation_id,
|
|
|
e
|
|
e
|
|
|
);
|
|
);
|
|
|
tx.rollback().await?;
|
|
tx.rollback().await?;
|
|
|
- } else {
|
|
|
|
|
- tx.commit().await?;
|
|
|
|
|
- tracing::info!(
|
|
|
|
|
- "Successfully recovered and finalized internal settlement saga {}",
|
|
|
|
|
- saga.operation_id
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
|
|
+ tx.commit().await?;
|
|
|
|
|
+ tracing::info!(
|
|
|
|
|
+ "Successfully recovered and finalized internal settlement saga {}",
|
|
|
|
|
+ saga.operation_id
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
continue; // Skip to next saga
|
|
continue; // Skip to next saga
|
|
|
}
|
|
}
|
|
@@ -473,28 +474,29 @@ impl Mint {
|
|
|
.await
|
|
.await
|
|
|
{
|
|
{
|
|
|
tracing::error!(
|
|
tracing::error!(
|
|
|
- "Failed to finalize paid melt saga {}: {}",
|
|
|
|
|
|
|
+ "Failed to finalize paid melt saga {}: {}. Will retry on next recovery cycle.",
|
|
|
saga.operation_id,
|
|
saga.operation_id,
|
|
|
err
|
|
err
|
|
|
);
|
|
);
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Delete saga after successful finalization
|
|
// Delete saga after successful finalization
|
|
|
let mut tx = self.localstore.begin_transaction().await?;
|
|
let mut tx = self.localstore.begin_transaction().await?;
|
|
|
if let Err(e) = tx.delete_saga(&saga.operation_id).await {
|
|
if let Err(e) = tx.delete_saga(&saga.operation_id).await {
|
|
|
tracing::error!(
|
|
tracing::error!(
|
|
|
- "Failed to delete saga for {}: {}",
|
|
|
|
|
|
|
+ "Failed to delete saga {}: {}. Will retry on next recovery cycle.",
|
|
|
saga.operation_id,
|
|
saga.operation_id,
|
|
|
e
|
|
e
|
|
|
);
|
|
);
|
|
|
tx.rollback().await?;
|
|
tx.rollback().await?;
|
|
|
- } else {
|
|
|
|
|
- tx.commit().await?;
|
|
|
|
|
- tracing::info!(
|
|
|
|
|
- "Successfully recovered and finalized melt saga {}",
|
|
|
|
|
- saga.operation_id
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
|
|
+ tx.commit().await?;
|
|
|
|
|
+ tracing::info!(
|
|
|
|
|
+ "Successfully recovered and finalized melt saga {}",
|
|
|
|
|
+ saga.operation_id
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
continue; // Skip compensation, saga handled
|
|
continue; // Skip compensation, saga handled
|
|
|
}
|
|
}
|