+ started = false
+}
+
+func statusHandler(w http.ResponseWriter, r *http.Request) {
+ runStatus := "started"
+ if !started {
+ runStatus = "stopped"
+ }
+ fmt.Fprintf(w, `{"status": "%v"}`, runStatus)
+}
+
+func deleteOnShutdown(s chan os.Signal) {
+ signal.Notify(s, os.Interrupt)
+ signal.Notify(s, syscall.SIGTERM)
+ <-s
+ log.Info("Shutting down gracefully.")
+ if err := deleteJob(); err != nil {
+ log.Errorf("Unable to delete job on shutdown due to: %v. Please remove job %v manually.", err, jobId)
+ }