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 17, 2024
1 parent e1e68ad commit 2298b3b
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 2298b3b

Please sign in to comment.