1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-07-17 01:32:22 +02:00

Fixed graceful process termination (#240)

This commit is contained in:
Tim Voronov
2019-02-26 15:32:50 -05:00
committed by GitHub
parent 63dfcdeefd
commit b702f127ed
4 changed files with 26 additions and 39 deletions

View File

@ -9,7 +9,6 @@ import (
"io/ioutil"
"os"
"os/signal"
"syscall"
)
func ExecFile(pathToFile string, opts Options) {
@ -38,18 +37,10 @@ func Exec(query string, opts Options) {
l := NewLogger()
ctx, err := opts.WithContext(context.Background())
ctx, cancel := opts.WithContext(context.Background())
if err != nil {
fmt.Println("Failed to register HTML drivers")
fmt.Println(err)
os.Exit(1)
return
}
ctx, cancel := context.WithCancel(ctx)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP)
signal.Notify(c, os.Interrupt)
go func() {
for {