Files
query-orchestration/api/queryVersionSyncRunner/runner.go
T

41 lines
648 B
Go
Raw Normal View History

package queryversionsyncrunner
import (
"context"
"log/slog"
2025-03-05 12:05:46 +00:00
queryversionsync "queryorchestration/internal/query/versionsync"
"github.com/google/uuid"
)
const Name = "queryVersionSyncRunner"
type Services struct {
Sync *queryversionsync.Service
}
type Runner struct {
svc *Services
}
func New(svc *Services) Runner {
return Runner{
svc: svc,
}
}
type Body struct {
QueryID uuid.UUID `json:"id" validate:"required,uuid"`
}
func (s *Runner) Process(ctx context.Context, body Body) bool {
err := s.svc.Sync.Sync(ctx, body.QueryID)
if err != nil {
slog.Error("unable to process", "error", err)
return false
}
return true
}