consul: Adding a sanity check

This commit is contained in:
Armon Dadgar 2014-02-05 11:13:08 -08:00
parent f0134e42c6
commit a58ee71739
1 changed files with 5 additions and 0 deletions

View File

@ -162,6 +162,11 @@ func (s *Server) blockingRPC(b *structs.BlockingQuery, tables MDBTables, run fun
goto RUN_QUERY
}
// Sanity check that we have tables to block on
if len(tables) == 0 {
panic("no tables to block on")
}
// Restrict the max query time
if b.MaxQueryTime > maxQueryTime {
b.MaxQueryTime = maxQueryTime