ripple-api/app/v1/meta.go
2016-04-07 19:32:48 +02:00

23 lines
420 B
Go

package v1
import (
"os"
"syscall"
"github.com/osuripple/api/common"
)
// MetaRestartGET restarts the API with Zero Downtime™.
func MetaRestartGET(md common.MethodData) (r common.Response) {
proc, err := os.FindProcess(syscall.Getpid())
if err != nil {
r.Code = 500
r.Message = "couldn't find process. what the fuck?"
return
}
r.Code = 200
r.Message = "brb"
go proc.Signal(syscall.SIGUSR2)
return
}