good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
open
bor
Commits
7ddb4023
Unverified
Commit
7ddb4023
authored
4 years ago
by
ucwong
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ethdb/leveldb: use timer instead of time.After (#21066)
parent
2f66a8d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ethdb/leveldb/leveldb.go
+5
-1
5 additions, 1 deletion
ethdb/leveldb/leveldb.go
with
5 additions
and
1 deletion
ethdb/leveldb/leveldb.go
+
5
−
1
View file @
7ddb4023
...
...
@@ -248,6 +248,9 @@ func (db *Database) meter(refresh time.Duration) {
merr
error
)
timer
:=
time
.
NewTimer
(
refresh
)
defer
timer
.
Stop
()
// Iterate ad infinitum and collect the stats
for
i
:=
1
;
errc
==
nil
&&
merr
==
nil
;
i
++
{
// Retrieve the database stats
...
...
@@ -399,7 +402,8 @@ func (db *Database) meter(refresh time.Duration) {
select
{
case
errc
=
<-
db
.
quitChan
:
// Quit requesting, stop hammering the database
case
<-
time
.
After
(
refresh
)
:
case
<-
timer
.
C
:
timer
.
Reset
(
refresh
)
// Timeout, gather a new set of stats
}
}
...
...
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