Files
query-orchestration/cmd/querySyncRunner/main.go
T
Jay Brown 0ddae4f91e Merged in feature/remove-query (pull request #201)
remove query from codebase part 1

* remove query

* fix localstack run
2026-01-14 17:59:04 +00:00

60 lines
1.7 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_query_plan.md for details on the query removal.
package main
import (
"context"
"log/slog"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"queryorchestration/internal/serviceconfig/build"
)
const serviceName = "querySyncRunner"
func main() {
// Print version information
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.")
// Start minimal HTTP server for health checks (required for cloud deployments)
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)
}
}()
// Wait for shutdown signal
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())
// Gracefully shutdown the HTTP server
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)
}
}