Commit bdc1798a authored by David Fifield's avatar David Fifield
Browse files

Exit immediately after SIGTERM is there are no signals running.

Cf. https://bugs.torproject.org/24875
parent 6a9c2bf9
......@@ -241,11 +241,8 @@ func main() {
ln.Close()
}
snowflakes.End()
for n := range handlerChan {
numHandlers += n
if numHandlers == 0 {
break
}
for numHandlers > 0 {
numHandlers += <-handlerChan
}
log.Println("snowflake is done.")
}
......@@ -393,10 +393,7 @@ func main() {
for _, server := range servers {
server.Close()
}
for n := range handlerChan {
numHandlers += n
if numHandlers == 0 {
break
}
for numHandlers > 0 {
numHandlers += <-handlerChan
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment