From 62c95dc5b53fadc1e2a35c2f9e3de7f91a485f1b Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Thu, 26 May 2022 10:22:17 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=B0=B1?= =?UTF-8?q?=E8=BF=91=E8=B7=AF=E7=94=B1=E6=94=AF=E6=8C=81=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/quickstart/provider/main.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/examples/quickstart/provider/main.go b/examples/quickstart/provider/main.go index ea7dc25c..5c9aadcd 100644 --- a/examples/quickstart/provider/main.go +++ b/examples/quickstart/provider/main.go @@ -120,6 +120,23 @@ func (svr *PolarisProvider) deregisterService() { log.Fatalf("fail to deregister instance, err is %v", err) } log.Printf("deregister successfully.") + go svr.doHeartbeat() +} + +func (svr *PolarisProvider) doHeartbeat() { + log.Printf("start to invoke heartbeat operation") + ticker := time.NewTicker(time.Duration(5 * time.Second)) + for range ticker.C { + if !svr.isShutdown { + heartbeatRequest := &polaris.InstanceHeartbeatRequest{} + heartbeatRequest.Namespace = namespace + heartbeatRequest.Service = service + heartbeatRequest.Host = svr.host + heartbeatRequest.Port = svr.port + heartbeatRequest.ServiceToken = token + svr.provider.Heartbeat(heartbeatRequest) + } + } } func (svr *PolarisProvider) runMainLoop() { From e045c1b1db20cad4980553926ec948b5c1b675c4 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Fri, 12 Aug 2022 12:09:32 +0800 Subject: [PATCH 2/5] rebase upstream/master --- examples/quickstart/provider/main.go | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/quickstart/provider/main.go b/examples/quickstart/provider/main.go index 5c9aadcd..3bc7dce9 100644 --- a/examples/quickstart/provider/main.go +++ b/examples/quickstart/provider/main.go @@ -120,7 +120,6 @@ func (svr *PolarisProvider) deregisterService() { log.Fatalf("fail to deregister instance, err is %v", err) } log.Printf("deregister successfully.") - go svr.doHeartbeat() } func (svr *PolarisProvider) doHeartbeat() { From 50ff9737c570c5bea113947aa5771b9233fa65d6 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Tue, 21 Mar 2023 11:50:16 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Ddemo=E4=B8=AD?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1import=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/quickstart/provider/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/quickstart/provider/main.go b/examples/quickstart/provider/main.go index 3bc7dce9..cbeaa20f 100644 --- a/examples/quickstart/provider/main.go +++ b/examples/quickstart/provider/main.go @@ -27,6 +27,7 @@ import ( "os/signal" "strings" "syscall" + "time" "github.com/polarismesh/polaris-go" ) From fcbf6cb614523d324514be872071b3b2b1ea36ae Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Tue, 21 Mar 2023 11:50:59 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Ddemo=E4=B8=AD?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1import=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/quickstart/provider/main.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/examples/quickstart/provider/main.go b/examples/quickstart/provider/main.go index cbeaa20f..ea7dc25c 100644 --- a/examples/quickstart/provider/main.go +++ b/examples/quickstart/provider/main.go @@ -27,7 +27,6 @@ import ( "os/signal" "strings" "syscall" - "time" "github.com/polarismesh/polaris-go" ) @@ -123,22 +122,6 @@ func (svr *PolarisProvider) deregisterService() { log.Printf("deregister successfully.") } -func (svr *PolarisProvider) doHeartbeat() { - log.Printf("start to invoke heartbeat operation") - ticker := time.NewTicker(time.Duration(5 * time.Second)) - for range ticker.C { - if !svr.isShutdown { - heartbeatRequest := &polaris.InstanceHeartbeatRequest{} - heartbeatRequest.Namespace = namespace - heartbeatRequest.Service = service - heartbeatRequest.Host = svr.host - heartbeatRequest.Port = svr.port - heartbeatRequest.ServiceToken = token - svr.provider.Heartbeat(heartbeatRequest) - } - } -} - func (svr *PolarisProvider) runMainLoop() { ch := make(chan os.Signal, 1) signal.Notify(ch, []os.Signal{ From 4e743a202a65c83120fba8c06e8cc6a3771b7b82 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Wed, 4 Dec 2024 16:45:37 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9B=91=E5=90=AC=E5=8F=AF=E8=83=BD=E5=AF=BC?= =?UTF-8?q?=E8=87=B4OOM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/flow/watch_flow.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/flow/watch_flow.go b/pkg/flow/watch_flow.go index 7c762010..d0c57adb 100644 --- a/pkg/flow/watch_flow.go +++ b/pkg/flow/watch_flow.go @@ -256,7 +256,7 @@ func (w *WatchEngine) longPullAllServices( Value: latestServices.GetValue(), Revision: latestServices.GetRevision(), HashValue: latestServices.GetHashValue(), - }, nil), nil + }, w.CancelWatch), nil } func (w *WatchEngine) WatchAllInstances(