Skip to content

Commit

Permalink
re-embed app.js, catch webproc interupt
Browse files Browse the repository at this point in the history
  • Loading branch information
jpillora committed Oct 11, 2016
1 parent f2c3b65 commit 4519d38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,16 @@ func Run(c Config) error {
signals := make(chan os.Signal)
signal.Notify(signals)
for sig := range signals {
if a.running() {
if sig == os.Interrupt {
a.log.Printf("webproc interupted, exiting...")
if a.running() {
a.procSigs <- os.Kill
time.Sleep(100 * time.Millisecond)
}
os.Exit(0)
} else if a.running() {
//proxy through to proc
a.procSigs <- sig
} else if sig == os.Interrupt {
a.log.Printf("interupt with no proc, exiting...")
os.Exit(0)
} else {
a.log.Printf("ignored signal: %s", sig)
}
Expand Down
4 changes: 2 additions & 2 deletions agent/agent_static.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4519d38

Please sign in to comment.