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
823bba8d
Commit
823bba8d
authored
Dec 11, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change from db_text to nvarchar
parent
dc49bebb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
pkg/infra/serverlock/migrations.go
+1
-1
pkg/infra/serverlock/serverlock.go
+1
-0
pkg/services/cleanup/cleanup.go
+9
-3
No files found.
pkg/infra/serverlock/migrations.go
View file @
823bba8d
...
...
@@ -8,7 +8,7 @@ func (sl *ServerLockService) AddMigration(mg *migrator.Migrator) {
Name
:
"server_lock"
,
Columns
:
[]
*
migrator
.
Column
{
{
Name
:
"id"
,
Type
:
migrator
.
DB_BigInt
,
IsPrimaryKey
:
true
,
IsAutoIncrement
:
true
},
{
Name
:
"operation_uid"
,
Type
:
migrator
.
DB_
Text
},
{
Name
:
"operation_uid"
,
Type
:
migrator
.
DB_
NVarchar
,
Length
:
100
},
{
Name
:
"version"
,
Type
:
migrator
.
DB_BigInt
},
{
Name
:
"last_execution"
,
Type
:
migrator
.
DB_BigInt
,
Nullable
:
false
},
},
...
...
pkg/infra/serverlock/serverlock.go
View file @
823bba8d
...
...
@@ -21,6 +21,7 @@ type ServerLockService struct {
// Init this service
func
(
sl
*
ServerLockService
)
Init
()
error
{
sl
.
log
=
log
.
New
(
"infra.lockservice"
)
return
nil
}
...
...
pkg/services/cleanup/cleanup.go
View file @
823bba8d
...
...
@@ -7,6 +7,8 @@ import (
"path"
"time"
"github.com/grafana/grafana/pkg/infra/serverlock"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/log"
m
"github.com/grafana/grafana/pkg/models"
...
...
@@ -15,8 +17,9 @@ import (
)
type
CleanUpService
struct
{
log
log
.
Logger
Cfg
*
setting
.
Cfg
`inject:""`
log
log
.
Logger
Cfg
*
setting
.
Cfg
`inject:""`
ServerLockService
*
serverlock
.
ServerLockService
`inject:""`
}
func
init
()
{
...
...
@@ -38,7 +41,10 @@ func (srv *CleanUpService) Run(ctx context.Context) error {
srv
.
cleanUpTmpFiles
()
srv
.
deleteExpiredSnapshots
()
srv
.
deleteExpiredDashboardVersions
()
srv
.
deleteOldLoginAttempts
()
srv
.
ServerLockService
.
OncePerServerGroup
(
ctx
,
"delete old login attempts"
,
time
.
Minute
*
10
,
func
()
{
srv
.
deleteOldLoginAttempts
()
})
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
}
...
...
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