fix: strategyStickySessions nil pointer
This commit is contained in:
parent
aa0753ac59
commit
05a484ec56
1 changed files with 2 additions and 2 deletions
|
@ -147,7 +147,7 @@ func strategyStickySessions() strategyFn {
|
||||||
}
|
}
|
||||||
Sessions := make(map[string]map[string]Session)
|
Sessions := make(map[string]map[string]Session)
|
||||||
go func() {
|
go func() {
|
||||||
for true {
|
for {
|
||||||
time.Sleep(time.Second * 60)
|
time.Sleep(time.Second * 60)
|
||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
for _, subMap := range Sessions {
|
for _, subMap := range Sessions {
|
||||||
|
@ -174,7 +174,7 @@ func strategyStickySessions() strategyFn {
|
||||||
session.time = now
|
session.time = now
|
||||||
|
|
||||||
var i int
|
var i int
|
||||||
var res C.Proxy
|
var res = proxies[0]
|
||||||
for i := 0; i < length; i++ {
|
for i := 0; i < length; i++ {
|
||||||
idx := (session.idx + i) % length
|
idx := (session.idx + i) % length
|
||||||
proxy := proxies[idx]
|
proxy := proxies[idx]
|
||||||
|
|
Loading…
Reference in a new issue