Files
query-orchestration/api/querySyncRunner/runner.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

44 lines
769 B
Go

package querysyncrunner
import (
"context"
"log/slog"
querysync "queryorchestration/internal/query/sync"
"github.com/go-playground/validator/v10"
"github.com/google/uuid"
)
const Name = "querySyncRunner"
type Services struct {
QuerySync *querysync.Service
}
type Runner struct {
validator *validator.Validate
svc *Services
}
func New(validator *validator.Validate, svc *Services) Runner {
return Runner{
validator: validator,
svc: svc,
}
}
type Body struct {
DocumentID uuid.UUID `json:"id" validate:"required,uuid"`
}
func (s *Runner) Process(ctx context.Context, body Body) bool {
err := s.svc.QuerySync.Sync(ctx, body.DocumentID)
if err != nil {
slog.Error("unable to process", "error", err)
return false
}
return true
}