mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
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) {
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue