Code Review: Make double-drain a panic.

This commit is contained in:
Matt T. Proud 2013-06-06 12:40:06 +02:00
parent e217a9fb41
commit 819045541e

View file

@ -133,15 +133,11 @@ func (t *TieredStorage) Drain(drained chan<- bool) {
func (t *TieredStorage) drain(drained chan<- bool) {
if t.state >= tieredStorageDraining {
drained <- true
return
panic("Illegal State: Supplemental drain requested.")
}
select {
case t.draining <- (drained):
log.Println("Triggering drain...")
default:
}
log.Println("Triggering drain...")
t.draining <- (drained)
}
// Enqueues a ViewRequestBuilder for materialization, subject to a timeout.