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
a87dd175
Unverified
Commit
a87dd175
authored
Feb 17, 2021
by
Emil Tullstedt
Committed by
GitHub
Feb 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UsageStats: Purpose named variables (#31264)
parent
8f20b13f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
pkg/infra/usagestats/service.go
+6
-6
No files found.
pkg/infra/usagestats/service.go
View file @
a87dd175
...
...
@@ -54,18 +54,18 @@ func (uss *UsageStatsService) Init() error {
func
(
uss
*
UsageStatsService
)
Run
(
ctx
context
.
Context
)
error
{
uss
.
updateTotalStats
()
onceEveryDayTick
:=
time
.
NewTicker
(
time
.
Hour
*
24
)
everyMinute
Ticker
:=
time
.
NewTicker
(
time
.
Minute
*
30
)
defer
onceEveryDayTick
.
Stop
()
defer
everyMinute
Ticker
.
Stop
()
sendReportTicker
:=
time
.
NewTicker
(
time
.
Hour
*
24
)
updateStats
Ticker
:=
time
.
NewTicker
(
time
.
Minute
*
30
)
defer
sendReportTicker
.
Stop
()
defer
updateStats
Ticker
.
Stop
()
for
{
select
{
case
<-
onceEveryDayTick
.
C
:
case
<-
sendReportTicker
.
C
:
if
err
:=
uss
.
sendUsageStats
(
ctx
);
err
!=
nil
{
metricsLogger
.
Warn
(
"Failed to send usage stats"
,
"err"
,
err
)
}
case
<-
everyMinute
Ticker
.
C
:
case
<-
updateStats
Ticker
.
C
:
uss
.
updateTotalStats
()
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