Skip to content

Commit

Permalink
Add sigterm to interupt signals list
Browse files Browse the repository at this point in the history
  • Loading branch information
saolof committed May 23, 2024
1 parent b2135ba commit 21922d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"os"
"os/signal"
"runtime/debug"
"syscall"

_ "github.com/mattn/go-sqlite3"
"github.com/robfig/cron/v3"
Expand Down Expand Up @@ -42,7 +43,7 @@ func makeJobs(cronfile string, databasefile string, logger *log.Logger, monitor
}

func run(ctx context.Context, w io.Writer, logger *log.Logger, webport int, check bool, crontab, databases, historyfile string, args []string) error {
ctx, stop := signal.NotifyContext(ctx, os.Interrupt)
ctx, stop := signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM)
defer stop()
db, err := sql.Open("sqlite3", historyfile)
if err != nil {
Expand Down

0 comments on commit 21922d4

Please sign in to comment.