mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
增加stop命令
This commit is contained in:
@@ -108,6 +108,7 @@ func (slf *Service) Run() {
|
||||
if bStop == true {
|
||||
if atomic.AddInt32(&slf.gorouterNum,-1)<=0 {
|
||||
slf.startStatus = false
|
||||
slf.Release()
|
||||
slf.OnRelease()
|
||||
}
|
||||
break
|
||||
@@ -120,8 +121,7 @@ func (slf *Service) GetName() string{
|
||||
return slf.name
|
||||
}
|
||||
|
||||
|
||||
func (slf *Service) OnRelease(){
|
||||
func (slf *Service) Release(){
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
buf := make([]byte, 40960)
|
||||
@@ -134,6 +134,9 @@ func (slf *Service) OnRelease(){
|
||||
slf.this.OnRelease()
|
||||
}
|
||||
|
||||
func (slf *Service) OnRelease(){
|
||||
}
|
||||
|
||||
func (slf *Service) OnInit() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user