Skip to content

Commit

Permalink
Fixed populate command issue (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
paullla authored Sep 23, 2023
1 parent 67667af commit 8eec576
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MessageHandler/PopulateCurrentDataTrackersHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Locastic\Loggastic\Bridge\Elasticsearch\Context\ElasticsearchContextFactoryInterface;
use Locastic\Loggastic\Bridge\Elasticsearch\Context\Traits\ElasticNormalizationContextTrait;
use Locastic\Loggastic\Bridge\Elasticsearch\ElasticsearchService;
use Locastic\Loggastic\Factory\ActivityLogInputFactory;
use Locastic\Loggastic\Factory\CurrentDataTrackerInputFactoryInterface;
use Locastic\Loggastic\Message\PopulateCurrentDataTrackersMessage;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
Expand All @@ -16,7 +16,7 @@ final class PopulateCurrentDataTrackersHandler
{
use ElasticNormalizationContextTrait;

public function __construct(private readonly ManagerRegistry $managerRegistry, private readonly ActivityLogInputFactory $activityLogInputFactory, private readonly NormalizerInterface $objectNormalizer, private readonly ElasticsearchService $elasticService, private readonly ElasticsearchContextFactoryInterface $elasticsearchContextFactory)
public function __construct(private readonly ManagerRegistry $managerRegistry, private readonly CurrentDataTrackerInputFactoryInterface $currentDataTrackerInputFactory, private readonly NormalizerInterface $objectNormalizer, private readonly ElasticsearchService $elasticService, private readonly ElasticsearchContextFactoryInterface $elasticsearchContextFactory)
{
}

Expand Down Expand Up @@ -44,7 +44,7 @@ public function __invoke(PopulateCurrentDataTrackersMessage $message): void
echo 'Processing object '.$item->getId()."\r\n";

$normalizedItem = $this->objectNormalizer->normalize($item, 'activityLog', $this->getNormalizationContext($loggableContext));
$currentDataTrackers[] = $this->activityLogInputFactory->createFromActivityLogMessage($item, $normalizedItem);
$currentDataTrackers[] = $this->currentDataTrackerInputFactory->create($item, $normalizedItem);
}

$elasticContext = $this->elasticsearchContextFactory->create($message->getLoggableClass());
Expand Down

0 comments on commit 8eec576

Please sign in to comment.