Skip to content

Commit

Permalink
Fix bug with budgeted fs wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks committed Sep 7, 2024
1 parent 4fbbeb7 commit a62bc1e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Fixed

- Fix a bug that may have resulted in Wireit attempting to open too many files
at once (no known reports).

## [0.14.9] - 2024-09-03

Expand Down
1 change: 0 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default tseslint.config(
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
'@typescript-eslint/no-unnecessary-template-expression': 'off',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
'@typescript-eslint/return-await': 'off',
},
},
);
16 changes: 8 additions & 8 deletions src/util/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export async function mkdir(
): Promise<string | undefined> {
const reservation = await fileBudget.reserve();
try {
return fs.mkdir(path, options);
return await fs.mkdir(path, options);
} finally {
reservation[Symbol.dispose]();
}
Expand All @@ -85,7 +85,7 @@ export async function mkdir(
export async function mkdtemp(path: string): Promise<string> {
const reservation = await fileBudget.reserve();
try {
return fs.mkdtemp(path);
return await fs.mkdtemp(path);
} finally {
reservation[Symbol.dispose]();
}
Expand All @@ -98,7 +98,7 @@ export async function writeFile(
): Promise<void> {
const reservation = await fileBudget.reserve();
try {
return fs.writeFile(path, contents, encoding);
return await fs.writeFile(path, contents, encoding);
} finally {
reservation[Symbol.dispose]();
}
Expand All @@ -110,7 +110,7 @@ export async function readFile(
): Promise<string> {
const reservation = await fileBudget.reserve();
try {
return fs.readFile(path, encoding);
return await fs.readFile(path, encoding);
} finally {
reservation[Symbol.dispose]();
}
Expand All @@ -122,7 +122,7 @@ export async function rm(
): Promise<void> {
const reservation = await fileBudget.reserve();
try {
return fs.rm(path, options);
return await fs.rm(path, options);
} finally {
reservation[Symbol.dispose]();
}
Expand All @@ -131,7 +131,7 @@ export async function rm(
export async function lstat(path: string): Promise<fsTypes.Stats> {
const reservation = await fileBudget.reserve();
try {
return fs.lstat(path);
return await fs.lstat(path);
} finally {
reservation[Symbol.dispose]();
}
Expand All @@ -140,7 +140,7 @@ export async function lstat(path: string): Promise<fsTypes.Stats> {
export async function stat(path: string): Promise<fsTypes.Stats> {
const reservation = await fileBudget.reserve();
try {
return fs.stat(path);
return await fs.stat(path);
} finally {
reservation[Symbol.dispose]();
}
Expand All @@ -149,7 +149,7 @@ export async function stat(path: string): Promise<fsTypes.Stats> {
export async function access(path: string): Promise<void> {
const reservation = await fileBudget.reserve();
try {
return fs.access(path);
return await fs.access(path);
} finally {
reservation[Symbol.dispose]();
}
Expand Down

0 comments on commit a62bc1e

Please sign in to comment.