open-nomad/helper/users
Seth Hoenig af28ac1610
users: create cache for user lookups (#16100)
* users: create cache for user lookups

This PR introduces a global cache for OS user lookups. This should
relieve pressure on the OS domain/directory lookups, which would be
queried more now that Task API exists.

Hits are cached for 1 hour, and misses are cached for 1 minute. These
values are fairly arbitrary - we can tweak them if there is any reason to.

Closes #16010

* users: delete expired negative entry from cache
2023-02-09 08:37:50 -06:00
..
cache.go users: create cache for user lookups (#16100) 2023-02-09 08:37:50 -06:00
cache_test.go users: create cache for user lookups (#16100) 2023-02-09 08:37:50 -06:00
lookup.go users: create cache for user lookups (#16100) 2023-02-09 08:37:50 -06:00
lookup_linux_test.go
lookup_unix.go users: create cache for user lookups (#16100) 2023-02-09 08:37:50 -06:00
lookup_windows_test.go