Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
ripple-cron-go
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kurikku
backend
ripple-cron-go
Commits
994666c0
Commit
994666c0
authored
8 years ago
by
Howl
Browse files
Options
Downloads
Patches
Plain Diff
Add DeleteOldPrivateTokens
parent
5f93ac3d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cron.go
+6
-0
6 additions, 0 deletions
cron.go
with
6 additions
and
0 deletions
cron.go
+
6
−
0
View file @
994666c0
...
@@ -35,6 +35,7 @@ type config struct {
...
@@ -35,6 +35,7 @@ type config struct {
RemoveDonorOnExpired
bool
RemoveDonorOnExpired
bool
FixMultipleCompletedScores
bool
`description:"Set completed=2 if multiple completed=3 scores for same beatmap and user are present."`
FixMultipleCompletedScores
bool
`description:"Set completed=2 if multiple completed=3 scores for same beatmap and user are present."`
ClearExpiredProfileBackgrounds
bool
ClearExpiredProfileBackgrounds
bool
DeleteOldPrivateTokens
bool
`description:"Whether to delete old private (private = 1) API tokens (older than a month)"`
Workers
int
`description:"The number of goroutines which should execute queries. Increasing it may make cron faster, depending on your system."`
Workers
int
`description:"The number of goroutines which should execute queries. Increasing it may make cron faster, depending on your system."`
}
}
...
@@ -128,6 +129,11 @@ func main() {
...
@@ -128,6 +129,11 @@ func main() {
beatmaps.ranked != '4';`
)
beatmaps.ranked != '4';`
)
color
.
Green
(
" ok!"
)
color
.
Green
(
" ok!"
)
}
}
if
c
.
DeleteOldPrivateTokens
{
fmt
.
Println
(
"Starting deleting old private API tokens"
)
go
op
(
`DELETE FROM tokens WHERE private = 1 AND last_updated < ?`
,
time
.
Now
()
.
Add
(
-
time
.
Hour
*
24
*
30
))
color
.
Green
(
" ok!"
)
}
if
c
.
UnrankScoresOnInvalidBeatmaps
{
if
c
.
UnrankScoresOnInvalidBeatmaps
{
fmt
.
Print
(
"Unranking scores on invalid beatmaps..."
)
fmt
.
Print
(
"Unranking scores on invalid beatmaps..."
)
go
op
(
`DELETE scores.* FROM scores
go
op
(
`DELETE scores.* FROM scores
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment