mirror of
https://github.com/caddyserver/caddy.git
synced 2025-12-08 06:09:53 +00:00
api: Add all in-flight requests /reverse_proxy/upstreams (#7277)
This commit is contained in:
parent
65e0ddc221
commit
aa1af53b86
4 changed files with 79 additions and 11 deletions
10
usagepool.go
10
usagepool.go
|
|
@ -194,6 +194,16 @@ func (up *UsagePool) Delete(key any) (deleted bool, err error) {
|
|||
return deleted, err
|
||||
}
|
||||
|
||||
func (up *UsagePool) Load(key any) any {
|
||||
up.RLock()
|
||||
defer up.RUnlock()
|
||||
upv, loaded := up.pool[key]
|
||||
if loaded {
|
||||
return upv.value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// References returns the number of references (count of usages) to a
|
||||
// key in the pool, and true if the key exists, or false otherwise.
|
||||
func (up *UsagePool) References(key any) (int, bool) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue