Просмотр исходного кода

On second thought, don't close send queues when expiring.

Could panic if a sender is holding on to the channel.
David Fifield 6 лет назад
Родитель
Сommit
37b64f1825
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      turbotunnel/clientmap.go

+ 1 - 2
turbotunnel/clientmap.go

@@ -75,8 +75,7 @@ type clientMapInner struct {
 // than timeout in the past.
 func (inner *clientMapInner) removeExpired(now time.Time, timeout time.Duration) {
 	for len(inner.byAge) > 0 && now.Sub(inner.byAge[0].LastSeen) >= timeout {
-		record := heap.Pop(inner).(*clientRecord)
-		close(record.SendQueue)
+		heap.Pop(inner)
 	}
 }