Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
5af0b924
Commit
5af0b924
authored
Jun 07, 2018
by
Torkel Ödegaard
Committed by
bergquist
Jun 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring: renamed AddCtxHandler to AddHandlerCtx PR #12203
parent
442e0e43
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
pkg/bus/bus.go
+4
-4
pkg/services/notifications/notifications.go
+2
-2
pkg/services/sqlstore/stats.go
+1
-1
pkg/services/sqlstore/user.go
+1
-1
No files found.
pkg/bus/bus.go
View file @
5af0b924
...
...
@@ -28,7 +28,7 @@ type Bus interface {
InTransaction
(
ctx
context
.
Context
,
fn
func
(
ctx
context
.
Context
)
error
)
error
AddHandler
(
handler
HandlerFunc
)
Add
CtxHandler
(
handler
HandlerFunc
)
Add
HandlerCtx
(
handler
HandlerFunc
)
AddEventListener
(
handler
HandlerFunc
)
AddWildcardListener
(
handler
HandlerFunc
)
...
...
@@ -146,7 +146,7 @@ func (b *InProcBus) AddHandler(handler HandlerFunc) {
b
.
handlers
[
queryTypeName
]
=
handler
}
func
(
b
*
InProcBus
)
Add
CtxHandler
(
handler
HandlerFunc
)
{
func
(
b
*
InProcBus
)
Add
HandlerCtx
(
handler
HandlerFunc
)
{
handlerType
:=
reflect
.
TypeOf
(
handler
)
queryTypeName
:=
handlerType
.
In
(
1
)
.
Elem
()
.
Name
()
b
.
handlers
[
queryTypeName
]
=
handler
...
...
@@ -168,8 +168,8 @@ func AddHandler(implName string, handler HandlerFunc) {
}
// Package level functions
func
Add
CtxHandler
(
implName
string
,
handler
HandlerFunc
)
{
globalBus
.
Add
CtxHandler
(
handler
)
func
Add
HandlerCtx
(
implName
string
,
handler
HandlerFunc
)
{
globalBus
.
Add
HandlerCtx
(
handler
)
}
// Package level functions
...
...
pkg/services/notifications/notifications.go
View file @
5af0b924
...
...
@@ -45,8 +45,8 @@ func (ns *NotificationService) Init() error {
ns
.
Bus
.
AddHandler
(
ns
.
validateResetPasswordCode
)
ns
.
Bus
.
AddHandler
(
ns
.
sendEmailCommandHandler
)
ns
.
Bus
.
Add
CtxHandler
(
ns
.
sendEmailCommandHandlerSync
)
ns
.
Bus
.
Add
CtxHandler
(
ns
.
SendWebhookSync
)
ns
.
Bus
.
Add
HandlerCtx
(
ns
.
sendEmailCommandHandlerSync
)
ns
.
Bus
.
Add
HandlerCtx
(
ns
.
SendWebhookSync
)
ns
.
Bus
.
AddEventListener
(
ns
.
signUpStartedHandler
)
ns
.
Bus
.
AddEventListener
(
ns
.
signUpCompletedHandler
)
...
...
pkg/services/sqlstore/stats.go
View file @
5af0b924
...
...
@@ -14,7 +14,7 @@ func init() {
bus
.
AddHandler
(
"sql"
,
GetDataSourceAccessStats
)
bus
.
AddHandler
(
"sql"
,
GetAdminStats
)
bus
.
AddHandler
(
"sql"
,
GetSystemUserCountStats
)
bus
.
Add
CtxHandler
(
"sql"
,
GetSystemUserCountStatsCtx
)
bus
.
Add
HandlerCtx
(
"sql"
,
GetSystemUserCountStatsCtx
)
}
var
activeUserTimeLimit
=
time
.
Hour
*
24
*
30
...
...
pkg/services/sqlstore/user.go
View file @
5af0b924
...
...
@@ -31,7 +31,7 @@ func init() {
bus
.
AddHandler
(
"sql"
,
DeleteUser
)
bus
.
AddHandler
(
"sql"
,
UpdateUserPermissions
)
bus
.
AddHandler
(
"sql"
,
SetUserHelpFlag
)
bus
.
Add
CtxHandler
(
"sql"
,
CreateUserCtx
)
bus
.
Add
HandlerCtx
(
"sql"
,
CreateUserCtx
)
}
func
getOrgIdForNewUser
(
cmd
*
m
.
CreateUserCommand
,
sess
*
DBSession
)
(
int64
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment