1
0
Fork 0

온도 락걸리는 문제 수정

This commit is contained in:
Sangbum Kim 2017-09-11 00:49:41 +09:00
parent dd5ab35273
commit 2d0aaf58a5
1 changed files with 2 additions and 2 deletions

View File

@ -177,8 +177,7 @@ func (p *processor) getMaxTempetureOnProcessor(tempeturePathGlob string) (maxTem
} }
tempetureReadWaiter := &sync.WaitGroup{} tempetureReadWaiter := &sync.WaitGroup{}
queue := make(chan float64, len(matches)) queue := make(chan float64, len(matches)-1)
defer close(queue)
// exclude package temp // exclude package temp
for _, tempetureFilePath := range matches[1:] { for _, tempetureFilePath := range matches[1:] {
@ -186,6 +185,7 @@ func (p *processor) getMaxTempetureOnProcessor(tempeturePathGlob string) (maxTem
go p.readTempeture(tempetureFilePath, queue, tempetureReadWaiter) go p.readTempeture(tempetureFilePath, queue, tempetureReadWaiter)
} }
tempetureReadWaiter.Wait() tempetureReadWaiter.Wait()
close(queue)
for sense := range queue { for sense := range queue {
if maxTempeture < sense { if maxTempeture < sense {
maxTempeture = sense maxTempeture = sense