Skip to content

Commit 2f30b61

Browse files
committed
decode job payload data if it is a string
1 parent 8d5ab05 commit 2f30b61

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Recorders/JobRecorder/JobRecorder.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,15 @@ protected function getJobProperties(): array
7070
$properties = [];
7171

7272
foreach ($payload as $key => $value) {
73-
if (! in_array($key, ['job', 'data', 'displayName'])) {
73+
if (!in_array($key, ['job', 'data', 'displayName'])) {
7474
$properties[$key] = $value;
75+
76+
if (is_string($payload['data'])) {
77+
try {
78+
$properties['data'] = json_decode($payload['data'], true, 512, JSON_THROW_ON_ERROR);
79+
} catch (Exception $exception) {
80+
}
81+
}
7582
}
7683
}
7784

0 commit comments

Comments
 (0)