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
9ca9a7c3
Commit
9ca9a7c3
authored
Jun 12, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bus: dont start transaction when creating session
parent
629eab0b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
pkg/services/sqlstore/session.go
+0
-1
pkg/services/sqlstore/transactions.go
+5
-0
No files found.
pkg/services/sqlstore/session.go
View file @
9ca9a7c3
...
...
@@ -29,7 +29,6 @@ func startSession(ctx context.Context) *DBSession {
if
!
ok
{
newSess
:=
newSession
()
newSess
.
Begin
()
return
newSess
}
...
...
pkg/services/sqlstore/transactions.go
View file @
9ca9a7c3
...
...
@@ -17,6 +17,10 @@ func (ss *SqlStore) inTransactionWithRetry(ctx context.Context, fn func(ctx cont
sess
:=
startSession
(
ctx
)
defer
sess
.
Close
()
if
err
:=
sess
.
Begin
();
err
!=
nil
{
return
err
}
withValue
:=
context
.
WithValue
(
ctx
,
ContextSessionName
,
sess
)
err
:=
fn
(
withValue
)
...
...
@@ -59,6 +63,7 @@ func inTransactionWithRetryCtx(ctx context.Context, callback dbTransactionFunc,
var
err
error
sess
:=
startSession
(
ctx
)
defer
sess
.
Close
()
if
err
=
sess
.
Begin
();
err
!=
nil
{
...
...
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