Commit 1fa9bc05 authored by David Fifield's avatar David Fifield
Browse files

Remove SIGINT handling (no longer part of pt-spec).

parent c3f87281
......@@ -198,9 +198,9 @@ func main() {
var numHandlers int = 0
var sig os.Signal
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
signal.Notify(sigChan, syscall.SIGTERM)
// wait for first signal
// keep track of handlers and wait for a signal
sig = nil
for sig == nil {
select {
......@@ -209,17 +209,16 @@ func main() {
case sig = <-sigChan:
}
}
// signal received, shut down
for _, ln := range listeners {
ln.Close()
}
snowflakes.End()
// wait for second signal or no more handlers
sig = nil
for sig == nil && numHandlers != 0 {
select {
case n := <-handlerChan:
numHandlers += n
case sig = <-sigChan:
for n := range handlerChan {
numHandlers += n
if numHandlers == 0 {
break
}
}
log.Println("snowflake is done.")
......
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