Skip to content

Commit

Permalink
Merge pull request #123 from nitrictech/feature/friendly-exit
Browse files Browse the repository at this point in the history
feat: make more friendly output when interrupt is used
  • Loading branch information
HomelessDinosaur authored Mar 1, 2022
2 parents 4426eb2 + 22a913b commit 7a34760
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/run/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ nitric run -s ../projectX/ "functions/*.ts"`,
select {
case membraneError := <-memerr:
fmt.Println(errors.WithMessage(membraneError, "membrane error, exiting"))
case sigTerm := <-term:
fmt.Printf("Received %v, exiting\n", sigTerm)
case <-term:
fmt.Println("Shutting down services - exiting")
}

for _, f := range functions {
Expand Down
4 changes: 2 additions & 2 deletions pkg/tasklet/tasklet.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ func Run(runner Runner, opts Opts) error {
case <-timer.C:
err = errors.New("tasklet timedout after " + opts.Timeout.String())
case <-done:
case sigTerm := <-opts.Signal:
err = fmt.Errorf("received %v, exiting", sigTerm)
case <-opts.Signal:
fmt.Println("Shutting down services - exiting")
}

elapsed := time.Since(start)
Expand Down

0 comments on commit 7a34760

Please sign in to comment.