mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-06-13 15:47:38 +08:00
perf: modernize io paths and reduce proxy allocations
This commit is contained in:
parent
02861b5537
commit
54f7de0c60
11 changed files with 312 additions and 29 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"net/http"
|
||||
"net/textproto"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
|
@ -404,10 +405,5 @@ func reverseProxyStatusIsUnhealthy(config ReverseProxyPassiveHealthConfig, statu
|
|||
if status <= 0 {
|
||||
return false
|
||||
}
|
||||
for _, unhealthyStatus := range config.UnhealthyStatus {
|
||||
if status == unhealthyStatus {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(config.UnhealthyStatus, status)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue