Skip to content

Commit

Permalink
fix: improve performance for loq class
Browse files Browse the repository at this point in the history
  • Loading branch information
IamSebastianDev committed Dec 3, 2022
1 parent de0b1f9 commit b464576
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/Db/Loq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export class Loq {
}

const { size } = await stat(destination);
let lines = (await readFile(destination, 'utf-8')).split('\n');

if (size > this.#maxSafeFileSize) {
let lines = (await readFile(destination, 'utf-8')).split('\n');
lines = lines.filter((_, i) => i > 100);
await writeFile(destination, lines.join('\n'), 'utf-8');
}
Expand Down

0 comments on commit b464576

Please sign in to comment.