Skip to content

Commit

Permalink
[Change, Task] #32 if 1000 entries exceeded, only replace last if hdo…
Browse files Browse the repository at this point in the history
…p is good
  • Loading branch information
Type-Style committed Feb 2, 2024
1 parent 1145e9e commit 19aa8eb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/models/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ export const entry = {

if (entries.length >= 1000) {
logger.log(`File over 1000 lines: ${fileObj.path}`);
entries[entries.length - 1] = entry; // replace last entry
if (entry.hdop < 12 || (lastEntry && entry.hdop < lastEntry.hdop)) {
entries[entries.length - 1] = entry; // replace last entry
}
} else {
entries.push(entry);
}

}

file.write(res, fileObj, next);

Expand Down

0 comments on commit 19aa8eb

Please sign in to comment.