Code Review: Make double-drain a panic.
This commit is contained in:
parent
e217a9fb41
commit
819045541e
|
@ -133,15 +133,11 @@ func (t *TieredStorage) Drain(drained chan<- bool) {
|
||||||
|
|
||||||
func (t *TieredStorage) drain(drained chan<- bool) {
|
func (t *TieredStorage) drain(drained chan<- bool) {
|
||||||
if t.state >= tieredStorageDraining {
|
if t.state >= tieredStorageDraining {
|
||||||
drained <- true
|
panic("Illegal State: Supplemental drain requested.")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
|
||||||
case t.draining <- (drained):
|
|
||||||
log.Println("Triggering drain...")
|
log.Println("Triggering drain...")
|
||||||
default:
|
t.draining <- (drained)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enqueues a ViewRequestBuilder for materialization, subject to a timeout.
|
// Enqueues a ViewRequestBuilder for materialization, subject to a timeout.
|
||||||
|
|
Loading…
Reference in New Issue