We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4a8ab0 commit c065892Copy full SHA for c065892
src/lib/clients/cache.ts
@@ -19,14 +19,14 @@ export class Cache<T> {
19
private readonly timeToLive: number = DEFAULT_CACHE_TTL,
20
private readonly maxSize: number = DEFAULT_MAX_CACHE_SIZE,
21
) {
22
- if (timeToLive <= 0) {
+ if (this.timeToLive <= 0) {
23
throw new Error('TTL must be positive');
24
}
25
if (maxSize <= 0) {
26
throw new Error('Max size must be positive');
27
28
29
- this.cleanupInterval = setInterval(() => this.cleanup(), timeToLive);
+ this.cleanupInterval = setInterval(() => this.cleanup(), this.timeToLive);
30
31
32
/**
0 commit comments