Skip to content

Commit

Permalink
BC BREAK(history): change ProcessedMessage::$tags column to string
Browse files Browse the repository at this point in the history
Closes #29
  • Loading branch information
kbond committed Oct 17, 2023
1 parent 1a6b813 commit 69710bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/doctrine/mapping/ProcessedMessage.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<field name="finishedAt" column="finished_at" type="datetime_immutable" />
<field name="memoryUsage" column="memory_usage" type="integer" />
<field name="transport" column="transport" />
<field name="tags" column="tags" type="json" />
<field name="tags" column="tags" nullable="true" />
<field name="failureType" column="failure_type" nullable="true" />
<field name="failureMessage" column="failure_message" type="text" nullable="true" />
<field name="results" column="results" type="json" />
Expand Down
7 changes: 3 additions & 4 deletions src/History/Model/ProcessedMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ abstract class ProcessedMessage
private \DateTimeImmutable $finishedAt;
private int $memoryUsage;
private string $transport;

/** @var string[] */
private array $tags;
private ?string $tags;

/** @var class-string<\Throwable> */
private ?string $failureType = null;
Expand All @@ -51,6 +49,7 @@ public function __construct(Envelope $envelope, Results $results, ?\Throwable $e
{
$monitorStamp = $envelope->last(MonitorStamp::class) ?? throw new \LogicException('Required stamp not available');
$type = new Type($envelope->getMessage());
$tags = new Tags($envelope);

$this->runId = $monitorStamp->runId();
$this->type = $type->class();
Expand All @@ -60,7 +59,7 @@ public function __construct(Envelope $envelope, Results $results, ?\Throwable $e
$this->finishedAt = $monitorStamp->finishedAt();
$this->memoryUsage = $monitorStamp->memoryUsage();
$this->transport = $monitorStamp->transport();
$this->tags = (new Tags($envelope))->all();
$this->tags = $tags->count() ? (string) $tags : null;
$this->results = $results;

if ($retryStamp = $envelope->last(RedeliveryStamp::class)) {
Expand Down

0 comments on commit 69710bb

Please sign in to comment.