Skip to content

Commit

Permalink
=新增接口
Browse files Browse the repository at this point in the history
  • Loading branch information
liangdas committed Jun 10, 2019
1 parent 3993fbe commit f5c3275
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type DefaultApp struct {
settings conf.Config
serverList sync.Map
processId string
workDir string
opts module.Options
routes map[string]func(app module.App, Type string, hash string) module.ServerSession
defaultRoutes func(app module.App, Type string, hash string) module.ServerSession
Expand Down Expand Up @@ -139,7 +140,7 @@ func (app *DefaultApp) Run(debug bool, mods ...module.Module) error {
}

}

app.workDir=ApplicationDir
defaultConfPath := fmt.Sprintf("/%s/bin/conf/server.json", ApplicationDir)
defaultLogPath := fmt.Sprintf("%s/bin/logs", ApplicationDir)
defaultBIPath := fmt.Sprintf("%s/bin/bi", ApplicationDir)
Expand Down Expand Up @@ -388,6 +389,9 @@ func (app *DefaultApp) GetSettings() conf.Config {
func (app *DefaultApp) GetProcessID() string {
return app.processId
}
func (app *DefaultApp) WorkDir() string {
return app.workDir
}
func (app *DefaultApp) RpcInvoke(module module.RPCModule, moduleType string, _func string, params ...interface{}) (result interface{}, err string) {
server, e := app.GetRouteServer(moduleType, module.GetServerId())
if e != nil {
Expand Down
1 change: 1 addition & 0 deletions module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type App interface {
ProtocolMarshal(Trace string, Result interface{}, Error string) (ProtocolMarshal, string)
NewProtocolMarshal(data []byte) ProtocolMarshal
GetProcessID() string
WorkDir() string
}

type Module interface {
Expand Down
1 change: 1 addition & 0 deletions rpc/base/nats_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func (s *NatsServer) on_request_handle() error {
for {
m, err := subs.NextMsg(time.Minute)
if err != nil && err == nats.ErrTimeout {
//log.Warning("NatsServer error with '%v'",err)
continue
} else if err != nil {
//log.Error("NatsServer error with '%v'",err)
Expand Down

0 comments on commit f5c3275

Please sign in to comment.