mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-23 09:10:04 +00:00
Replace time-dependent cache limiting with LRU
To keep memory usage as constant as possible, the previous cache purging at periodic time intervals has been replaced by an LRU that discards the oldest string when the capacity of the cache is reached. Also fixed some formatting and commenting issues, and added better testing for the rate limiter. Signed-off-by: Wendi Yu <wendi.yu@yahoo.ca>
This commit is contained in:
@@ -51,8 +51,8 @@ func main() {
|
||||
statepath := getopt.StringLong("state", 0, paths.DefaultTailscaledStateFile(), "Path of state file")
|
||||
socketpath := getopt.StringLong("socket", 's', paths.DefaultTailscaledSocket(), "Path of the service unix socket")
|
||||
|
||||
rlPrint := logger.RateLimitedFn(log.Printf, 1, 1)
|
||||
logf := wgengine.RusagePrefixLog(rlPrint)
|
||||
logf := wgengine.RusagePrefixLog(log.Printf)
|
||||
logf = logger.RateLimitedFn(logf, 1, 1, 100)
|
||||
|
||||
err := fixconsole.FixConsoleIfNeeded()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user