Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
a6a64526
Commit
a6a64526
authored
10 years ago
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(blockservice/worker) replace time.Tick with a timer we can stop
parent
e3c9f6db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
blockservice/worker/worker.go
blockservice/worker/worker.go
+3
-1
No files found.
blockservice/worker/worker.go
View file @
a6a64526
...
...
@@ -84,6 +84,8 @@ func (w *Worker) start(c Config) {
defer
close
(
workerChan
)
var
workQueue
BlockList
debugInfo
:=
time
.
NewTicker
(
5
*
time
.
Second
)
defer
debugInfo
.
Stop
()
for
{
// take advantage of the fact that sending on nil channel always
...
...
@@ -99,7 +101,7 @@ func (w *Worker) start(c Config) {
// if worker is ready and there's a block to process, send the
// block
case
sendToWorker
<-
nextBlock
:
case
<-
time
.
Tick
(
5
*
time
.
Second
)
:
case
<-
debugInfo
.
C
:
if
workQueue
.
Len
()
>
0
{
log
.
Debugf
(
"%d blocks in blockservice provide queue..."
,
workQueue
.
Len
())
}
...
...
This diff is collapsed.
Click to expand it.
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