Skip to content

Commit

Permalink
+ Watch
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Feb 14, 2022
1 parent e1e36bc commit 3f7deb9
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 97 deletions.
2 changes: 1 addition & 1 deletion cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var startCmd = &cobra.Command{
fmt.Println("")

// 调试模式
if config.Conf.Mode == "debug" {
if mode == "development" {
service.Watch(config.Conf)
}

Expand Down
56 changes: 28 additions & 28 deletions data/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ func Start() {
Middlewares...)
}

// StartWithouttSession 启动服务
func StartWithouttSession() {

gou.SetHTTPGuards(Guards)
gou.ServeHTTP(
gou.Server{
Host: config.Conf.Host,
Port: config.Conf.Port,
Root: "/api",
},
&shutdown, func(s gou.Server) {
shutdownComplete <- true
},
Middlewares...)
}

// Stop 关闭服务
func Stop(onComplete func()) {
shutdown <- true
Expand Down
Loading

0 comments on commit 3f7deb9

Please sign in to comment.