From 73d384361d006f044aff9addf09756b7171259ea Mon Sep 17 00:00:00 2001 From: duanhf2012 <6549168@qq.com> Date: Fri, 30 Aug 2024 16:56:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Service=E5=A4=9A=E5=8D=8F?= =?UTF-8?q?=E7=A8=8B=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/service.go b/service/service.go index b06cab4..403d25c 100644 --- a/service/service.go +++ b/service/service.go @@ -151,28 +151,28 @@ func (s *Service) Start() { s.startStatus = true atomic.StoreInt32(&s.isRelease,0) var waitRun sync.WaitGroup + log.Info(s.GetName()+" service is running",) + s.self.(IService).OnStart() for i:=int32(0);i< s.goroutineNum;i++{ s.wg.Add(1) waitRun.Add(1) go func(){ - log.Info(s.GetName()+" service is running",) waitRun.Done() - s.Run() + s.run() }() } waitRun.Wait() } -func (s *Service) Run() { +func (s *Service) run() { defer s.wg.Done() var bStop = false concurrent := s.IConcurrent.(*concurrent.Concurrent) concurrentCBChannel := concurrent.GetCallBackChannel() - s.self.(IService).OnStart() for{ var analyzer *profiler.Analyzer select {