Files
Jay Brown 63c12a2f44 Merged in feature/eula.part1 (pull request #206)
eula support

* eula support

* docs
2026-01-22 18:17:27 +00:00

56 lines
1.5 KiB
Go

// DEPRECATED: This runner is deprecated and no longer has any functionality.
// It is left in place until deployment code is updated accordingly.
// See remove_texttract_and_mocks_plan.md for details.
package main
import (
"context"
"log/slog"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"queryorchestration/internal/serviceconfig/build"
)
const serviceName = "docTextRunner"
func main() {
build.PrintVersionInfo(serviceName)
slog.Warn("DEPRECATED: " + serviceName + " is deprecated and no longer has any functionality. " +
"This service is left in place until deployment code is updated accordingly.")
mux := http.NewServeMux()
mux.HandleFunc("/health", func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
})
server := &http.Server{
Addr: ":8080",
Handler: mux,
ReadHeaderTimeout: time.Minute,
}
go func() {
slog.Info("Starting health check server on port 8080")
if err := server.ListenAndServe(); err != http.ErrServerClosed {
slog.Error("Health check server error", "error", err)
}
}()
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
sig := <-sigChan
slog.Info(serviceName+" received shutdown signal, exiting gracefully", "signal", sig.String())
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := server.Shutdown(ctx); err != nil {
slog.Error("Error shutting down health check server", "error", err)
}
}