Skip to content

Commit

Permalink
fix: Make sure SetWithTtl#getAgeInSeconds return 0 for expired keys
Browse files Browse the repository at this point in the history
  • Loading branch information
SpraxDev committed Sep 12, 2024
1 parent ea1c7f3 commit 5d67090
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/minecraft/SetWithTtl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class SetWithTtl<T> {

getAgeInSeconds(key: T): number {
const expiration = this.values.get(key);
if (expiration == null) {
if (expiration == null || this.isExpired(expiration)) {
return 0;
}

Expand Down

0 comments on commit 5d67090

Please sign in to comment.