Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
fa34429a
Commit
fa34429a
authored
Jan 24, 2019
by
Janoš Guljaš
Committed by
Anton Evangelatov
Jan 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swarm: fix a data race on startTime (#18511)
parent
bbd12035
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
swarm.go
swarm/swarm.go
+3
-3
No files found.
swarm/swarm.go
View file @
fa34429a
...
...
@@ -56,7 +56,6 @@ import (
)
var
(
startTime
time
.
Time
updateGaugesPeriod
=
5
*
time
.
Second
startCounter
=
metrics
.
NewRegisteredCounter
(
"stack,start"
,
nil
)
stopCounter
=
metrics
.
NewRegisteredCounter
(
"stack,stop"
,
nil
)
...
...
@@ -80,6 +79,7 @@ type Swarm struct {
swap
*
swap
.
Swap
stateStore
*
state
.
DBStore
accountingMetrics
*
protocols
.
AccountingMetrics
startTime
time
.
Time
tracerClose
io
.
Closer
}
...
...
@@ -344,7 +344,7 @@ Start is called when the stack is started
*/
// implements the node.Service interface
func
(
self
*
Swarm
)
Start
(
srv
*
p2p
.
Server
)
error
{
startTime
=
time
.
Now
()
s
elf
.
s
tartTime
=
time
.
Now
()
self
.
tracerClose
=
tracing
.
Closer
...
...
@@ -414,7 +414,7 @@ func (self *Swarm) periodicallyUpdateGauges() {
}
func
(
self
*
Swarm
)
updateGauges
()
{
uptimeGauge
.
Update
(
time
.
Since
(
startTime
)
.
Nanoseconds
())
uptimeGauge
.
Update
(
time
.
Since
(
s
elf
.
s
tartTime
)
.
Nanoseconds
())
requestsCacheGauge
.
Update
(
int64
(
self
.
netStore
.
RequestsCacheLen
()))
}
...
...
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