Skip to content

Commit

Permalink
Fix bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Sep 1, 2024
1 parent 1217a4d commit aa61564
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions proxy/srs.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,9 @@ func (v *srsRedisLoadBalancer) Update(ctx context.Context, server *SRSServer) er
}

// Check each server expiration, if not exists in redis, remove from servers.
for i, serverKey := range serverKeys {
if _, err := v.rdb.Get(ctx, serverKey).Bytes(); err != nil {
for i := len(serverKeys) - 1; i >= 0; i-- {
if _, err := v.rdb.Get(ctx, serverKeys[i]).Bytes(); err != nil {
serverKeys = append(serverKeys[:i], serverKeys[i+1:]...)
continue
}
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/conf/origin1-for-proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ heartbeat {
enabled on;
interval 9;
url http://127.0.0.1:12025/api/v1/srs/register;
device_id origin2;
device_id origin1;
ports on;
}
vhost __defaultVhost__ {
Expand Down

0 comments on commit aa61564

Please sign in to comment.