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
7aa84aeb
Commit
7aa84aeb
authored
Dec 13, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moves migrations to /sqlstore/migrations
parent
dbcc2e86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
pkg/infra/serverlock/serverlock.go
+1
-1
pkg/services/sqlstore/migrations/migrations.go
+1
-0
pkg/services/sqlstore/migrations/serverlock_migrations.go
+2
-3
No files found.
pkg/infra/serverlock/serverlock.go
View file @
7aa84aeb
...
...
@@ -36,7 +36,7 @@ func (sl *ServerLockService) LockAndExecute(ctx context.Context, actionName stri
return
err
}
// avoid execution if last lock happened less than `ma
t
Interval` ago
// avoid execution if last lock happened less than `ma
x
Interval` ago
if
rowLock
.
LastExecution
!=
0
{
lastExeuctionTime
:=
time
.
Unix
(
rowLock
.
LastExecution
,
0
)
if
lastExeuctionTime
.
Unix
()
>
time
.
Now
()
.
Add
(
-
maxInterval
)
.
Unix
()
{
...
...
pkg/services/sqlstore/migrations/migrations.go
View file @
7aa84aeb
...
...
@@ -31,6 +31,7 @@ func AddMigrations(mg *Migrator) {
addTagMigration
(
mg
)
addLoginAttemptMigrations
(
mg
)
addUserAuthMigrations
(
mg
)
addServerlockMigrations
(
mg
)
}
func
addMigrationLogMigrations
(
mg
*
Migrator
)
{
...
...
pkg/
infra/serverlock/
migrations.go
→
pkg/
services/sqlstore/migrations/serverlock_
migrations.go
View file @
7aa84aeb
package
serverlock
package
migrations
import
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
// AddMigration create database migrations for server lock
func
(
sl
*
ServerLockService
)
AddMigration
(
mg
*
migrator
.
Migrator
)
{
func
addServerlockMigrations
(
mg
*
migrator
.
Migrator
)
{
serverLock
:=
migrator
.
Table
{
Name
:
"server_lock"
,
Columns
:
[]
*
migrator
.
Column
{
...
...
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