Files
query-orchestration/cmd/queryVersionSyncRunner/main.go
T
Michael McGuinness 81e7223560 Merged in feature/textextraction (pull request #110)
Text Extraction

* bases

* go

* splitting

* structure

* movetoasync

* movetoasync

* settinguptrigger

* reorder

* storevent

* standardisepollingvalidation

* unittests

* fixlint

* fixlint

* awscfg

* generatesample

* followthrough

* tests

* clena

* store

* externalidcleanup

* clientid

* local

* baseunittests

* putobjecttests

* tests
2025-04-02 18:50:03 +00:00

49 lines
1.1 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/queue/clientsync"
_ "github.com/lib/pq"
)
type QueryVersionSyncConfig struct {
runner.BaseConfig[queryversionsyncrunner.Body]
clientsync.ClientSyncConfig
}
func main() {
ctx := context.Background()
cfg := &QueryVersionSyncConfig{}
cfg.ControllerFunc = func() runner.Controller[queryversionsyncrunner.Body] {
svc := queryversionsync.New(cfg)
c := queryversionsyncrunner.New(cfg.GetValidator(), &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)
}