Files
query-orchestration/cmd/queryVersionSyncRunner/main.go
T
Jay Brown a6e081e5cd Merged in feature/log-version (pull request #185)
inject and print version at startup for all services

* inject and print version

* coverage
2025-09-18 21:06:21 +00:00

53 lines
1.2 KiB
Go

// **Listens For**: Body Containing Query ID
//
// **Action**.
//
// Adds an event for each client into the CLIENTSYNC queue for the given query, i.e. each client that contains the query in its dependency tree.
package main
import (
"context"
"log/slog"
"os"
queryversionsyncrunner "queryorchestration/api/queryVersionSyncRunner"
queryversionsync "queryorchestration/internal/query/versionsync"
"queryorchestration/internal/server/runner"
"queryorchestration/internal/serviceconfig/build"
"queryorchestration/internal/serviceconfig/queue/clientsync"
_ "github.com/lib/pq"
)
type QueryVersionSyncConfig struct {
runner.BaseConfig[queryversionsyncrunner.Body]
clientsync.ClientSyncConfig
}
func main() {
// Print version information before any environment checks
build.PrintVersionInfo("queryVersionSyncRunner")
ctx := context.Background()
cfg := &QueryVersionSyncConfig{}
cfg.ControllerFunc = func() runner.Controller[queryversionsyncrunner.Body] {
svc := queryversionsync.New(cfg)
c := queryversionsyncrunner.New(&queryversionsyncrunner.Services{
Sync: svc,
})
return &c
}
server, err := runner.New(ctx, cfg)
if err != nil {
slog.Error(err.Error())
os.Exit(1)
}
server.Listen(ctx)
}