Skip to content

Commit

Permalink
decode job payload data if it is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Dec 21, 2023
1 parent 8d5ab05 commit 2f30b61
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Recorders/JobRecorder/JobRecorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,15 @@ protected function getJobProperties(): array
$properties = [];

foreach ($payload as $key => $value) {
if (! in_array($key, ['job', 'data', 'displayName'])) {
if (!in_array($key, ['job', 'data', 'displayName'])) {
$properties[$key] = $value;

if (is_string($payload['data'])) {
try {
$properties['data'] = json_decode($payload['data'], true, 512, JSON_THROW_ON_ERROR);
} catch (Exception $exception) {
}
}
}
}

Expand Down

0 comments on commit 2f30b61

Please sign in to comment.