Files
query-orchestration/cmd/querySyncRunner/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

63 lines
1.5 KiB
Go

// **Listens For**: Body Containing Document ID
//
// **Action**.
//
// Find the queries with no dependencies that do not have a valid result for a document.
//
// The reasoning for only extracting these is to start the query extraction process only for necessary queries, and the query runner will manage updating downstream dependencies.
//
// There are 2 situations that cause a query to show up in this list:
//
// The query has no required dependencies.
//
// All required dependencies have a valid result.
//
// An event with the document id is pushed to the DOCTEXT queue.
package main
import (
"context"
"log/slog"
"os"
querysyncrunner "queryorchestration/api/querySyncRunner"
resultsync "queryorchestration/internal/query/result/sync"
querysync "queryorchestration/internal/query/sync"
"queryorchestration/internal/server/runner"
queryc "queryorchestration/internal/serviceconfig/queue/query"
_ "github.com/lib/pq"
)
type QuerySyncConfig struct {
runner.BaseConfig[querysyncrunner.Body]
queryc.QueryConfig
}
func main() {
ctx := context.Background()
cfg := &QuerySyncConfig{}
cfg.ControllerFunc = func() runner.Controller[querysyncrunner.Body] {
sync := resultsync.New(cfg)
svc := querysync.New(cfg, &querysync.Services{
ResultSync: sync,
})
c := querysyncrunner.New(cfg.GetValidator(), &querysyncrunner.Services{
QuerySync: svc,
})
return &c
}
server, err := runner.New(ctx, cfg)
if err != nil {
slog.Error(err.Error())
os.Exit(1)
}
server.Listen(ctx)
}