mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-27 00:51:55 +08:00
fix(mysql): fix the bug that crashes when mysql port conflicts
This commit is contained in:
+2
-1
@@ -302,10 +302,11 @@ func (s *Server) Run() {
|
|||||||
s.listener, err = vmysql.NewListener("tcp", s.Addr, authServer, s, s.VersionString, 0, 0)
|
s.listener, err = vmysql.NewListener("tcp", s.Addr, authServer, s, s.VersionString, 0, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("New MySQL Server failed: %s", err)
|
log.Error("New MySQL Server failed: %s", err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
s.livingLock.Lock()
|
||||||
if !s.Enable {
|
if !s.Enable {
|
||||||
s.listener.Close()
|
s.listener.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user