Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Merge worker to mainPool if txb fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Tzal3x committed Oct 19, 2023
1 parent fe59569 commit 00fe331
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/executorServiceHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ export class ExecutorServiceHandler {
// An available worker is found! Assign to it the task of executing the txb.
worker.status = 'busy'; // Worker is now busy

// TODO - catch dry-run fail error, remove worker, retrieve another worker and retry the execution
const result = await worker.pool.signAndExecuteTransactionBlock({
transactionBlock: txb,
client: client,
});

if (result.effects!.status.status === 'failure') {

Check warning on line 68 in src/executorServiceHandler.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Forbidden non-null assertion
this.removeWorker(worker);
return
}

worker.status = 'available'; // Execution finished, the worker is now available again.
return result;
}
Expand Down

0 comments on commit 00fe331

Please sign in to comment.