Snowflake proxy successfully reset and bootstrap a new client (#15)

This commit is contained in:
Serene Han 2016-01-22 12:22:09 -08:00
parent 133f657928
commit 77fbfe0e66
4 changed files with 33 additions and 25 deletions

View file

@ -171,7 +171,9 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
w.Write(offer)
case <-time.After(time.Second * 10):
// This snowflake is no longer available to serve clients.
heap.Remove(snowflakes, snowflake.index)
delete(snowflakeMap, snowflake.id)
w.WriteHeader(http.StatusGatewayTimeout)
}
}