Closed dominics closed 4 years ago
Perhaps relevant, from one of my private job classes:
/** * Normalizes the job payload * * The failure backend keeps the arguments and job type in an associative * array/JSON object: * * args: { * job: someJobName, * data: { * some_data: foo, * some_other_data: etc... * } * } * * However, when resque-web recreates failed jobs, it uses an array instead: * * args: [ * ['job', 'someJobName'], * ['data', {'some_data': foo, 'some_other_data': etc...}] * ] * @throws RuntimeException * @throws InvalidArgumentException */ protected function normalizePayload() { if (!isset($this->payload['args'])) { throw new RuntimeException('Payload has no arguments'); } if (!isset($this->payload['args']['job']) && isset($this->payload['args'][0][0]) && isset($this->payload['args'][1][0]) ) { $normalized = array(); foreach ($this->payload['args'] as $argument) { if (count($argument) == 2 && isset($argument[0]) && isset($argument[1])) { $normalized[$argument[0]] = $argument[1]; } else { throw new InvalidArgumentException('Invalid job arguments: could not normalize'); } } $this->payload['args'] = $normalized; } }
Wondering, ist there a reason why this pull request hasn't been merged yet. FYI - same error occurs on the newer resque web interface as well.
Perhaps relevant, from one of my private job classes: