tx7do / kratos-transport

kratos transport layer extension
MIT License
348 stars 95 forks source link

[BUG] runAsynqServer function mistakenly assert server is nil #23

Closed aegoens closed 2 years ago

aegoens commented 2 years ago

file: transport/asynq/server.go Sever.runAsynqServer
if asynqServer is not nil which is actually normal in this case, but it will return error

func (s *Server) runAsynqServer() error {
    if s.asynqServer != nil {
        log.Errorf("[asynq] asynq server is nil")
        return errors.New("asynq server is nil")
    }

    if err := s.asynqServer.Run(s.mux); err != nil {
        log.Errorf("[asynq] asynq server run failed: %s", err.Error())
        return err
    }
    return nil
}