mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-09 12:16:52 +00:00
1. Use time.Time for expiration to simplify expiration checks. 2. Added a stopChan and a Stop method to properly stop the invalidateTask goroutine instead of directly changing values 3. Used Ticker in invalidateTask for periodic expiration checks 4. Leak Prevention: The invalidateTask() loop checks the TTL value before continuing. If the TTL is zero, the goroutine exits gracefully, preventing a memory leak. Signed-off-by: sulemaanhamza <sulemanhamza97@gmail.com>
2.2 KiB
2.2 KiB