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 18, 2024
1 parent 741fdf1 commit 6fa9700
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 6fa9700

Please sign in to comment.