Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Commit 29e8abb

Browse files
author
Yevgeny Pats
committed
handle sigterm
1 parent 0be717c commit 29e8abb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

client/agent.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"log"
1010
"os"
1111
"os/exec"
12+
"os/signal"
13+
"syscall"
1214
)
1315

1416
const (
@@ -100,6 +102,14 @@ func (c *FuzzitClient) RunFuzzer(job Job, jobId string, updateDB bool) error {
100102
return err
101103
}
102104

105+
channel := make(chan os.Signal)
106+
signal.Notify(channel, syscall.SIGTERM)
107+
go func() {
108+
<-channel
109+
log.Println("VM interrupted. shutting down and relaunching...")
110+
os.Exit(0)
111+
}()
112+
103113
c.currentJob = job
104114
c.jobId = jobId
105115
c.updateDB = updateDB

client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
const FuzzitEndpoint = "https://app.fuzzit.dev"
14-
const Version = "v2.4.76"
14+
const Version = "v2.4.77"
1515

1616
type Target struct {
1717
Name string `firestore:"target_name"`

0 commit comments

Comments
 (0)