Skip to content

Commit

Permalink
putchunks: add signal handler
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Jan 3, 2025
1 parent f3ec652 commit de4ebcf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/putchunks.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"fmt"
"io"
"os"
"os/signal"
"syscall"

enc "github.com/named-data/ndnd/std/encoding"
"github.com/named-data/ndnd/std/engine"
Expand Down Expand Up @@ -92,6 +94,7 @@ func (pc *PutChunks) run() {
}

// wait forever
// TODO: quit on SIGTERM, SIGINT or face failure
select {}
sigchan := make(chan os.Signal, 1)
signal.Notify(sigchan, os.Interrupt, syscall.SIGTERM)
<-sigchan
}

0 comments on commit de4ebcf

Please sign in to comment.