Skip to content

Commit 46346a9

Browse files
committed
IND-515 fix compatibility issues
1 parent dbb8d3e commit 46346a9

7 files changed

Lines changed: 125 additions & 119 deletions

File tree

Command/CleanUpCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ class CleanUpCommand extends Command
1919

2020
public function __construct(ManagerRegistry $registry, JobManager $jobManager)
2121
{
22-
parent::__construct();
22+
parent::__construct('jms-job-queue:clean-up');
2323

24-
$this->setName('jms-job-queue:clean-up');
2524
$this->jobManager = $jobManager;
2625
$this->registry = $registry;
2726
}

Command/MarkJobIncompleteCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ class MarkJobIncompleteCommand extends Command
1818

1919
public function __construct(ManagerRegistry $managerRegistry, JobManager $jobManager)
2020
{
21-
parent::__construct();
21+
parent::__construct('jms-job-queue:mark-incomplete');
2222

23-
$this->setName('jms-job-queue:mark-incomplete');
2423
$this->registry = $managerRegistry;
2524
$this->jobManager = $jobManager;
2625
}

Command/RunCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ class RunCommand extends Command
6767

6868
public function __construct(ManagerRegistry $managerRegistry, JobManager $jobManager, EventDispatcherInterface $dispatcher, array $queueOptionsDefault, array $queueOptions)
6969
{
70-
parent::__construct();
70+
parent::__construct('jms-job-queue:run');
7171

72-
$this->setName('jms-job-queue:run');
7372
$this->registry = $managerRegistry;
7473
$this->jobManager = $jobManager;
7574
$this->dispatcher = $dispatcher;

Command/ScheduleCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ class ScheduleCommand extends Command
2323

2424
public function __construct(ManagerRegistry $managerRegistry, iterable $schedulers, iterable $cronCommands)
2525
{
26-
parent::__construct();
26+
parent::__construct('jms-job-queue:schedule');
2727

28-
$this->setName('jms-job-queue:schedule');
2928
$this->registry = $managerRegistry;
3029
$this->schedulers = $schedulers;
3130
$this->cronCommands = $cronCommands;

Console/Application.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,19 @@ private function saveDebugInformation(\Exception $ex = null)
8484
return;
8585
}
8686

87+
try {
88+
$trace = json_encode($ex ? FlattenException::create($ex)->toArray() : null, JSON_THROW_ON_ERROR);
89+
} catch (\JsonException) {
90+
$trace = null;
91+
}
92+
8793
$this->getConnection()->executeUpdate(
8894
"UPDATE jms_jobs SET stackTrace = :trace, memoryUsage = :memoryUsage, memoryUsageReal = :memoryUsageReal WHERE id = :id",
8995
array(
9096
'id' => $jobId,
9197
'memoryUsage' => memory_get_peak_usage(),
9298
'memoryUsageReal' => memory_get_peak_usage(true),
93-
'trace' => serialize($ex ? FlattenException::create($ex) : null),
99+
'trace' => $trace,
94100
),
95101
array(
96102
'id' => \PDO::PARAM_INT,

0 commit comments

Comments
 (0)