Skip to content

Commit

Permalink
fix:修复api目录下的RegisterInstance没有设置AutoHeartbeat (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun authored Jun 21, 2024
1 parent 1480d15 commit 383123b
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 271 deletions.
1 change: 1 addition & 0 deletions api/provider_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (c *providerAPI) RegisterInstance(instance *InstanceRegisterRequest) (*mode
if err := instance.Validate(); err != nil {
return nil, err
}
instance.AutoHeartbeat = true
return c.context.GetEngine().SyncRegister(&instance.InstanceRegisterRequest)
}

Expand Down
223 changes: 0 additions & 223 deletions examples/extensions/zeroprotect/main.go

This file was deleted.

27 changes: 0 additions & 27 deletions examples/extensions/zeroprotect/polaris.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions examples/mock/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM alpine:3.13.6

RUN sed -i 's!http://dl-cdn.alpinelinux.org/!https://mirrors.tencent.com/!g' /etc/apk/repositories

RUN set -eux && \
apk add tcpdump && \
apk add tzdata && \
apk add busybox-extras && \
apk add curl && \
apk add bash && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
date

COPY provider /root/provider

WORKDIR /root

CMD ["/root/provider", "-port", "28080"]
18 changes: 9 additions & 9 deletions examples/extensions/zeroprotect/go.mod → examples/mock/go.mod
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
module github.com/polarismesh/polaris-go-zeroprotect
module github.com/polarismesh/polaris-go-quickstart-provider

go 1.17

replace github.com/polarismesh/polaris-go => ../../../

require github.com/polarismesh/polaris-go v0.0.0-00010101000000-000000000000
require github.com/polarismesh/polaris-go v1.4.2

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/polarismesh/specification v1.3.2-alpha.2 // indirect
github.com/polarismesh/specification v1.4.1 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/sys v0.2.0 // indirect
Expand All @@ -36,3 +34,5 @@ require (
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

replace github.com/polarismesh/polaris-go => ../../
Loading

0 comments on commit 383123b

Please sign in to comment.