This commit is contained in:
crusader 2017-11-14 12:42:55 +09:00
parent 2f70541870
commit 23d5f5406a
3 changed files with 8 additions and 13 deletions

View File

@ -1,8 +1,8 @@
package external package external
import ( import (
"git.loafle.net/overflow/overflow_gateway_app/external/grpc" "git.loafle.net/overflow/overflow_gateway_websocket/external/grpc"
"git.loafle.net/overflow/overflow_gateway_app/external/redis" "git.loafle.net/overflow/overflow_gateway_websocket/external/redis"
) )
func ExternalInit() { func ExternalInit() {

12
external/grpc/pool.go vendored
View File

@ -6,7 +6,7 @@ import (
cgp "git.loafle.net/commons_go/grpc_pool" cgp "git.loafle.net/commons_go/grpc_pool"
"git.loafle.net/commons_go/logging" "git.loafle.net/commons_go/logging"
ooas "git.loafle.net/overflow/overflow_api_server/golang" ooas "git.loafle.net/overflow/overflow_api_server/golang"
"git.loafle.net/overflow/overflow_gateway_app/conf" "git.loafle.net/overflow/overflow_gateway_websocket/config"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
@ -14,10 +14,10 @@ var grpcPool cgp.Pool
func ExternalInit() { func ExternalInit() {
ph := &grpcPoolHandlers{} ph := &grpcPoolHandlers{}
ph.MaxCapacity = conf.Config.GRPC.Pool.MaxCapacity ph.MaxCapacity = config.Config.GRPC.Pool.MaxCapacity
ph.MaxIdle = conf.Config.GRPC.Pool.MaxIdle ph.MaxIdle = config.Config.GRPC.Pool.MaxIdle
ph.IdleTimeout = conf.Config.GRPC.Pool.IdleTimeout ph.IdleTimeout = config.Config.GRPC.Pool.IdleTimeout
ph.Wait = conf.Config.GRPC.Pool.Wait ph.Wait = config.Config.GRPC.Pool.Wait
grpcPool = cgp.New(ph) grpcPool = cgp.New(ph)
@ -39,7 +39,7 @@ type grpcPoolHandlers struct {
func (h *grpcPoolHandlers) Dial() (*grpc.ClientConn, interface{}, error) { func (h *grpcPoolHandlers) Dial() (*grpc.ClientConn, interface{}, error) {
var err error var err error
conn, err := grpc.Dial(conf.Config.GRPC.Addr, grpc.WithInsecure()) conn, err := grpc.Dial(config.Config.GRPC.Addr, grpc.WithInsecure())
if nil != err { if nil != err {
return nil, nil, err return nil, nil, err
} }

View File

@ -6,11 +6,6 @@ import:
- package: git.loafle.net/overflow/overflow_api_server - package: git.loafle.net/overflow/overflow_api_server
subpackages: subpackages:
- golang - golang
- package: git.loafle.net/overflow/overflow_gateway_app
subpackages:
- conf
- external/grpc
- external/redis
- package: github.com/garyburd/redigo - package: github.com/garyburd/redigo
subpackages: subpackages:
- redis - redis