Skip to content

Commit

Permalink
refactor(market): provide more debug logs related to getting draft pr…
Browse files Browse the repository at this point in the history
…oposals from pool
  • Loading branch information
grisha87 committed Jul 16, 2024
1 parent e2ab7e9 commit a02eee7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/market/market.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,20 @@ export class MarketModuleImpl implements MarketModule {
agreementOptions?: AgreementOptions,
signalOrTimeout?: number | AbortSignal,
): Promise<Agreement> {
this.logger.info("Trying to sign an agreement ...");
this.logger.info("Trying to sign an agreement...");
const signal = createAbortSignalFromTimeout(signalOrTimeout);

const getProposal = async () => {
try {
signal.throwIfAborted();
this.logger.debug("Acquiring proposal from draft proposal pool", {
draftPoolCounters: {
total: draftProposalPool.count(),
available: draftProposalPool.availableCount(),
},
});
const proposal = await draftProposalPool.acquire(signal);
this.logger.debug("Acquired proposal from the pool", { proposal });
if (signal.aborted) {
await draftProposalPool.release(proposal);
signal.throwIfAborted();
Expand Down

0 comments on commit a02eee7

Please sign in to comment.