Skip to content

Commit c065892

Browse files
committed
:chore: Use instance property (#1995)
1 parent c4a8ab0 commit c065892

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/clients/cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ export class Cache<T> {
1919
private readonly timeToLive: number = DEFAULT_CACHE_TTL,
2020
private readonly maxSize: number = DEFAULT_MAX_CACHE_SIZE,
2121
) {
22-
if (timeToLive <= 0) {
22+
if (this.timeToLive <= 0) {
2323
throw new Error('TTL must be positive');
2424
}
2525
if (maxSize <= 0) {
2626
throw new Error('Max size must be positive');
2727
}
2828

29-
this.cleanupInterval = setInterval(() => this.cleanup(), timeToLive);
29+
this.cleanupInterval = setInterval(() => this.cleanup(), this.timeToLive);
3030
}
3131

3232
/**

0 commit comments

Comments
 (0)