Skip to content

Commit 0e7dccc

Browse files
brosellbrl1TooTallNate
authored
Need to close the handle when there is a cache hit (#372)
Co-authored-by: brl1 <[email protected]> Co-authored-by: Nathan Rajlich <[email protected]>
1 parent ed00d30 commit 0e7dccc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/old-beers-melt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"get-uri": patch
3+
---
4+
5+
Close the file descriptor handle when there is a cache hit for `file:` protocol

packages/get-uri/src/file.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const file: GetUriProtocol<FileOptions> = async (
5050

5151
// if a `cache` was provided, check if the file has not been modified
5252
if (cache && cache.stat && stat && isNotModified(cache.stat, stat)) {
53+
await fdHandle.close();
5354
throw new NotModifiedError();
5455
}
5556

0 commit comments

Comments
 (0)