Skip to content

Commit

Permalink
cr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mabaasit committed Nov 1, 2024
1 parent 01b2f94 commit fa93b5d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions packages/compass-user-data/src/user-data.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,6 @@ describe('user-data', function () {
expect(mongoshData?.[1]).to.be.instanceOf(Stats);
}
});

it('reads many number of files', async function () {
const files = Array.from({ length: 10000 }, (_, i) => [
`data${i}.json`,
JSON.stringify({ name: `VSCode${i}` }),
]);

await Promise.all(
files.map(([filepath, data]) => writeFileToStorage(filepath, data))
);

const result = await getUserData().readAll();
expect(result.data).to.have.lengthOf(10000);
});
});

context('UserData.readOne', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-user-data/src/user-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class UserData<T extends z.Schema> {
private readonly serialize: SerializeContent<z.input<T>>;
private readonly deserialize: DeserializeContent;
private readonly getFileName: GetFileName;
private readonly semaphore = new Semaphore(1000);
private readonly semaphore = new Semaphore(100);

constructor(
private readonly validator: T,
Expand Down

0 comments on commit fa93b5d

Please sign in to comment.