motiv-labs / janus

An API Gateway written in Go
https://hellofresh.gitbooks.io/janus
MIT License
2.78k stars 318 forks source link

Change Signal to Reload Configuration #360

Open cchatfield opened 5 years ago

cchatfield commented 5 years ago

I am using Nomad to run Janus as a task. The task uses a template populated from Consul that builds the api definitions. There is the ability to send a change_signal to the task to prompt an action.

Is there a signal I can send the GO binary to force a reload?

https://www.nomadproject.io/docs/job-specification/template.html

https://golang.org/pkg/os/signal/

s4nji commented 5 years ago

@cchatfield Janus currently only handles SIGTERM and SIGINT which gracefully shuts down the application, so you will need to restart Janus to reload the configuration. However it should be possible to add SIGHUP handling to force configuration reload.