mirror of
				https://git.sr.ht/~cadence/bibliogram
				synced 2025-10-30 19:15:37 +00:00 
			
		
		
		
	Sweep caches on the ttl interval
This commit is contained in:
		
							parent
							
								
									bf3145b684
								
							
						
					
					
						commit
						51e85e6bb9
					
				| @ -9,6 +9,9 @@ class TtlCache { | ||||
| 		this.ttl = ttl | ||||
| 		/** @type {Map<string, {data: T, time: number}>} */ | ||||
| 		this.cache = new Map() | ||||
| 		this.sweepInterval = setInterval(() => { | ||||
| 			this.clean() | ||||
| 		}, this.ttl) | ||||
| 	} | ||||
| 
 | ||||
| 	clean() { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user