Skip to content

Commit

Permalink
Merge pull request #11 from golang-acexy/develop
Browse files Browse the repository at this point in the history
fix: 启动出现阻塞式
  • Loading branch information
acexy authored Jun 19, 2024
2 parents fb55e42 + 4587cab commit 249ce33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ginmodule/ginloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ func (g *GinModule) Register() (interface{}, error) {
if err = server.ListenAndServe(); err != nil {
status <- err
}
close(status)
}()
v, ok := <-status
if !ok {
select {
case <-time.After(time.Second):
return ginEngin, nil
case err = <-status:
return ginEngin, err
}
return nil, v
}

func (g *GinModule) Unregister(maxWaitSeconds uint) (gracefully bool, err error) {
Expand Down

0 comments on commit 249ce33

Please sign in to comment.