Files
query-orchestration/cmd/docCleanRunner/main.go
T
Michael McGuinness fee71e7740 Merged in feature/postprocessing (pull request #114)
Feature/postprocessing

* tests

* passtest

* fixshorttests

* mosttests

* improvingbasedockerfile

* testspeeds

* testing

* host

* canparallel

* clean

* passfullsuite

* singlepagemax

* test

* findfeatures

* findstables

* tbls

* tablestoo

* tablestoo

* lateraltests

* tableloc

* cleanup

* inlinetable

* childids

* cleanup

* tests
2025-04-22 14:40:16 +00:00

57 lines
1.2 KiB
Go

// **Listens For**: Body Containing Document ID.
//
// **Action**.
//
// If the document is not already clean according to the collector standards, a clean is triggered.
//
// An event with the document id is pushed to the DOCTEXT queue.
package main
import (
"context"
"log/slog"
"os"
doccleanrunner "queryorchestration/api/docCleanRunner"
documentclean "queryorchestration/internal/document/clean"
"queryorchestration/internal/server/runner"
"queryorchestration/internal/serviceconfig/objectstore"
"queryorchestration/internal/serviceconfig/queue/documenttexttrigger"
_ "github.com/lib/pq"
)
type DocCleanConfig struct {
runner.BaseConfig[doccleanrunner.Body]
documenttexttrigger.DocTextTriggerConfig
objectstore.ObjectStoreConfig
}
func main() {
ctx := context.Background()
cfg := &DocCleanConfig{}
cfg.ControllerFunc = func() runner.Controller[doccleanrunner.Body] {
clean := documentclean.New(cfg)
return doccleanrunner.New(&doccleanrunner.Services{
Clean: clean,
})
}
server, err := runner.New(ctx, cfg)
if err != nil {
slog.Error(err.Error())
os.Exit(1)
}
err = cfg.SetStoreClient(ctx)
if err != nil {
slog.Error(err.Error())
os.Exit(1)
}
server.Listen(ctx)
}