a6e081e5cd
inject and print version at startup for all services * inject and print version * coverage
53 lines
1.1 KiB
Go
53 lines
1.1 KiB
Go
// **Listens For**: Body Containing Client ID
|
|
//
|
|
// **Action**.
|
|
//
|
|
// Adds an event for each document into the DOCSYNC queue for the given Client.
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"log/slog"
|
|
"os"
|
|
|
|
clientsyncrunner "queryorchestration/api/clientSyncRunner"
|
|
clientsync "queryorchestration/internal/client/sync"
|
|
"queryorchestration/internal/server/runner"
|
|
"queryorchestration/internal/serviceconfig/build"
|
|
"queryorchestration/internal/serviceconfig/queue/documentsync"
|
|
|
|
_ "github.com/lib/pq"
|
|
)
|
|
|
|
type ClientSyncConfig struct {
|
|
runner.BaseConfig[clientsyncrunner.Body]
|
|
documentsync.DocSyncConfig
|
|
}
|
|
|
|
func main() {
|
|
// Print version information before any environment checks
|
|
build.PrintVersionInfo("clientSyncRunner")
|
|
|
|
ctx := context.Background()
|
|
|
|
cfg := &ClientSyncConfig{}
|
|
|
|
cfg.ControllerFunc = func() runner.Controller[clientsyncrunner.Body] {
|
|
svc := clientsync.New(cfg)
|
|
|
|
c := clientsyncrunner.New(&clientsyncrunner.Services{
|
|
ClientSync: svc,
|
|
})
|
|
|
|
return &c
|
|
}
|
|
|
|
server, err := runner.New(ctx, cfg)
|
|
if err != nil {
|
|
slog.Error(err.Error())
|
|
os.Exit(1)
|
|
}
|
|
|
|
server.Listen(ctx)
|
|
}
|