Skip to content

Commit

Permalink
Merge pull request #2 from rentiansheng/joe511230_v3.5.x
Browse files Browse the repository at this point in the history
修复v3.5.x 支持http 优雅关闭后,v3.6.x 中新组件taskserver不支持的问题
  • Loading branch information
joe511230 committed Oct 22, 2019
2 parents 9d3aca3 + ca0a9e9 commit ef013ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/scene_server/task_server/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/emicklei/go-restful"
)

func Run(ctx context.Context, op *options.ServerOption) error {
func Run(ctx context.Context, cancel context.CancelFunc, op *options.ServerOption) error {
svrInfo, err := newServerInfo(op)
if err != nil {
blog.Errorf("wrap server info failed, err: %v", err)
Expand Down Expand Up @@ -88,7 +88,7 @@ func Run(ctx context.Context, op *options.ServerOption) error {
taskSrv.Core = engine
taskSrv.Service = service

if err := backbone.StartServer(ctx, engine, service.WebService(), true); err != nil {
if err := backbone.StartServer(ctx, cancel, engine, service.WebService(), true); err != nil {
blog.Errorf("start backbone failed, err: %+v", err)
return err
}
Expand Down
4 changes: 2 additions & 2 deletions src/scene_server/task_server/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func main() {
if err := common.SavePid(); err != nil {
blog.Errorf("fail to save pid: err:%s", err.Error())
}

if err := app.Run(context.Background(), op); err != nil {
ctx, cancel := context.WithCancel(context.Background())
if err := app.Run(ctx, cancel, op); err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)
blog.Errorf("process stopped by %v", err)
blog.CloseLogs()
Expand Down

0 comments on commit ef013ec

Please sign in to comment.