Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix init project abort #45

Merged
merged 1 commit into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@
cmd/discovery/discovery
dist/
configs/
go.sum
26 changes: 15 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#### Discovery

##### Version 1.1.1
1. fix initproject abort

##### Version 1.1.0
> 1. use kratos pkg
> 2. replace gin by kratos/bm
> 3. fix poll return nil when be canceled.
> 4. add init protect mode
> 5. supoort set.
1. use kratos pkg
2. replace gin by kratos/bm
3. fix poll return nil when be canceled.
4. add init protect mode
5. supoort set.

##### Version 1.0.2
> 1.fix nodesproc. get all zone nodes.
1.fix nodesproc. get all zone nodes.

##### Version 1.0.1
> 1.rename import path
1.rename import path

##### Version 1.0.0
> 1. discovery register&polls&replica
> 2. self-discovering nodes
> 3. metadata updates
> 4. naming client & grpc resolver
1. discovery register&polls&replica
2. self-discovering nodes
3. metadata updates
4. naming client & grpc resolver
7 changes: 3 additions & 4 deletions http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
var (
dis *discovery.Discovery
protected = true
errProtected = errors.New("discovery in protect mode,only support register")
errProtected = errors.New("discovery in protect mode and only support register")
)

// Init init http
Expand Down Expand Up @@ -47,8 +47,7 @@ func innerRouter(e *bm.Engine) {

func initProtect(ctx *bm.Context) {
if dis.Protected() {
ctx.JSONMap(map[string]interface{}{
"message": errProtected.Error(),
}, errProtected)
ctx.JSON(nil, errProtected)
ctx.AbortWithStatus(503)
}
}