Thanks to visit codestin.com
Credit goes to github.com

Skip to content

后台更新节点数据后及时刷新 #95

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

Merged
merged 1 commit into from
Nov 23, 2018
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: 1 addition & 0 deletions src/global/chan.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ var AuthorityChan = make(chan struct{}, 1)
var RoleChan = make(chan struct{}, 1)
var RoleAuthChan = make(chan struct{}, 1)
var UserSettingChan = make(chan struct{}, 1)
var TopicNodeChan = make(chan struct{}, 1)
2 changes: 2 additions & 0 deletions src/http/controller/admin/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package admin

import (
"global"
"logic"
"model"

Expand Down Expand Up @@ -54,6 +55,7 @@ func (NodeController) Modify(ctx echo.Context) error {
if err != nil {
return fail(ctx, 1, err.Error())
}
global.TopicNodeChan <- struct{}{}
return success(ctx, nil)
}

Expand Down
2 changes: 2 additions & 0 deletions src/server/studygolang/background.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ func loadData() {
logic.LoadRoleAuthorities()
case <-global.UserSettingChan:
logic.LoadUserSetting()
case <-global.TopicNodeChan:
logic.LoadNodes()
}
}
}
Expand Down