Skip to content

Commit

Permalink
fix: MemoryFifo return null when empty and timeout 0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr committed Apr 15, 2024
1 parent 0865b4d commit f0c2411
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yarn-project/foundation/src/fifo/memory_fifo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export class MemoryFifo<T> {
return Promise.resolve(null);
}

if (timeout === 0) {
return Promise.resolve(null);
}

return new Promise<T | null>((resolve, reject) => {
this.waiting.push(resolve);

Expand Down

0 comments on commit f0c2411

Please sign in to comment.