mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
remove gorm support
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -17,7 +17,6 @@ import (
|
||||
"github.com/fullstorydev/grpchan/inprocgrpc"
|
||||
"github.com/google/uuid"
|
||||
grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/justinas/alice"
|
||||
"github.com/rs/cors"
|
||||
"github.com/soheilhy/cmux"
|
||||
@ -36,7 +35,6 @@ type Service interface {
|
||||
greflect.GRPCServer
|
||||
|
||||
Options() Options
|
||||
DB() *gorm.DB
|
||||
Start() error
|
||||
Stop() error
|
||||
Close() error
|
||||
@ -138,10 +136,6 @@ func (s *service) Options() Options {
|
||||
return s.opts
|
||||
}
|
||||
|
||||
func (s *service) DB() *gorm.DB {
|
||||
return s.opts.db
|
||||
}
|
||||
|
||||
func (s *service) run() error {
|
||||
s.mu.Lock()
|
||||
s.closed = make(chan struct{})
|
||||
@ -365,9 +359,6 @@ func (s *service) GetServiceInfo() map[string]grpc.ServiceInfo {
|
||||
|
||||
func (s *service) Close() error {
|
||||
err := multierr.Combine(s.Stop())
|
||||
if s.opts.db != nil {
|
||||
err = multierr.Append(s.opts.db.Close(), err)
|
||||
}
|
||||
<-s.closed
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user