Files
query-orchestration/cmd/docCleanRunner/main.go
T

60 lines
1.5 KiB
Go
Raw Normal View History

// Listens For: Body Containing Document ID.
//
// Action:
// If the document is not already clean according to the collector standards, a clean is triggered.
// Note: Text extraction has been removed. The document pipeline ends after cleaning.
// See remove_texttract_and_mocks_plan.md for details.
package main
import (
"context"
"log/slog"
"os"
2025-03-05 12:05:46 +00:00
doccleanrunner "queryorchestration/api/docCleanRunner"
documentclean "queryorchestration/internal/document/clean"
"queryorchestration/internal/server/runner"
"queryorchestration/internal/serviceconfig/build"
2025-02-28 13:11:53 +00:00
"queryorchestration/internal/serviceconfig/objectstore"
_ "github.com/lib/pq"
)
// DocCleanConfig provides configuration for the document cleaning runner.
// Note: documenttext.DocTextConfig has been removed since text extraction is deprecated.
type DocCleanConfig struct {
runner.BaseConfig[doccleanrunner.Body]
2025-02-28 13:11:53 +00:00
objectstore.ObjectStoreConfig
}
func main() {
// Print version information before any environment checks
build.PrintVersionInfo("docCleanRunner")
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)
}
2025-02-28 13:11:53 +00:00
err = cfg.SetStoreClient(ctx)
if err != nil {
slog.Error(err.Error())
os.Exit(1)
}
server.Listen(ctx)
}