We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2e9cba commit 01b2f94Copy full SHA for 01b2f94
packages/compass-user-data/src/user-data.ts
@@ -124,8 +124,9 @@ export class UserData<T extends z.Schema> {
124
let data: string;
125
let stats: Stats;
126
let handle: fs.FileHandle | undefined = undefined;
127
- const release = await this.semaphore.waitForRelease();
+ let release: (() => void) | undefined = undefined;
128
try {
129
+ release = await this.semaphore.waitForRelease();
130
handle = await fs.open(absolutePath, 'r');
131
[stats, data] = await Promise.all([
132
handle.stat(),
@@ -142,7 +143,7 @@ export class UserData<T extends z.Schema> {
142
143
throw error;
144
} finally {
145
await handle?.close();
- release();
146
+ release?.();
147
}
148
149
0 commit comments