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-blockservice
Commits
90d665fb
Commit
90d665fb
authored
Jan 20, 2015
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
686220bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
worker/worker.go
worker/worker.go
+3
-1
No files found.
worker/worker.go
View file @
90d665fb
...
...
@@ -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
())
}
...
...
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