Remove redundant step args from log

[MAILPOET-4463]
This commit is contained in:
John Oleksowicz
2022-09-13 12:06:20 -05:00
committed by Jan Jakeš
parent d0f8d0f2bb
commit c828b7245d
5 changed files with 6 additions and 24 deletions

View File

@@ -39,18 +39,13 @@ class WorkflowRunLog {
/** @var string */
private $stepId;
/** @var array */
private $args;
public function __construct(
int $workflowRunId,
string $stepId,
array $args,
int $id = null
) {
$this->workflowRunId = $workflowRunId;
$this->stepId = $stepId;
$this->args = $args;
$this->status = self::STATUS_RUNNING;
if ($id) {
@@ -79,10 +74,6 @@ class WorkflowRunLog {
return $this->status;
}
public function getArgs(): array {
return $this->args;
}
public function getError(): array {
return $this->error;
}
@@ -126,7 +117,6 @@ class WorkflowRunLog {
'status' => $this->status,
'started_at' => $this->startedAt->format(DateTimeImmutable::W3C),
'completed_at' => $this->completedAt ? $this->completedAt->format(DateTimeImmutable::W3C) : null,
'args' => Json::encode($this->args),
'error' => Json::encode($this->error),
'data' => Json::encode($this->data),
];
@@ -154,12 +144,11 @@ class WorkflowRunLog {
}
public static function fromArray(array $data): self {
$workflowRunLog = new WorkflowRunLog((int)$data['workflow_run_id'], $data['step_id'], []);
$workflowRunLog = new WorkflowRunLog((int)$data['workflow_run_id'], $data['step_id']);
$workflowRunLog->id = (int)$data['id'];
$workflowRunLog->status = $data['status'];
$workflowRunLog->error = Json::decode($data['error']);
$workflowRunLog->data = Json::decode($data['data']);
$workflowRunLog->args = Json::decode($data['args']);
$workflowRunLog->startedAt = new DateTimeImmutable($data['started_at']);
if ($data['completed_at']) {