package documentsync import ( "context" "log/slog" doccleanrunner "queryorchestration/api/docCleanRunner" "queryorchestration/internal/serviceconfig/queue" "github.com/google/uuid" ) func (s *Service) Sync(ctx context.Context, id uuid.UUID) error { doc, err := s.svc.Document.Get(ctx, id) if err != nil { return err } j, err := s.svc.Client.Get(ctx, doc.ClientID) if err != nil { return err } if !j.CanSync { slog.Debug("not syncing document", "id", id.String()) return nil } slog.Debug("syncing document", "id", id.String()) err = s.cfg.SendToQueue(ctx, &queue.SendParams{ QueueURL: s.cfg.GetDocumentCleanURL(), Body: doccleanrunner.Body{ ID: id, }, }) if err != nil { return err } return nil }