-
Notifications
You must be signed in to change notification settings - Fork 0
Symfony7 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Symfony7 #1
Changes from all commits
1646d5e
a612c22
29f7c47
9ba0298
fc86ae8
92b2235
ecf7e53
39e25a9
b310465
dbb8d3e
46346a9
bc0dbd9
5ad649e
fb695f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ public function __construct(KernelInterface $kernel) | |
| } | ||
| } | ||
|
|
||
| public function doRun(InputInterface $input, OutputInterface $output) | ||
| public function doRun(InputInterface $input, OutputInterface $output): int | ||
| { | ||
| $this->input = $input; | ||
|
|
||
|
|
@@ -84,13 +84,19 @@ private function saveDebugInformation(\Exception $ex = null) | |
| return; | ||
| } | ||
|
|
||
| try { | ||
| $trace = json_encode($ex ? FlattenException::create($ex)->toArray() : null, JSON_THROW_ON_ERROR); | ||
| } catch (\JsonException) { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could |
||
| $trace = null; | ||
| } | ||
|
|
||
| $this->getConnection()->executeUpdate( | ||
| "UPDATE jms_jobs SET stackTrace = :trace, memoryUsage = :memoryUsage, memoryUsageReal = :memoryUsageReal WHERE id = :id", | ||
| array( | ||
| 'id' => $jobId, | ||
| 'memoryUsage' => memory_get_peak_usage(), | ||
| 'memoryUsageReal' => memory_get_peak_usage(true), | ||
| 'trace' => serialize($ex ? FlattenException::create($ex) : null), | ||
| 'trace' => $trace, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the past the data was a serialized PHP object; but now it has to be valid JSON.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't even think it's that ugly; it's an okay solution. Nice fix |
||
| ), | ||
| array( | ||
| 'id' => \PDO::PARAM_INT, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to move the name to the constructor because the constructor calls
configureat the very end. And if you then callsetNameafter the constructor already ran you can't extend commands anymore. This normally is not a problem, but Indiana extends theRunCommand(app:jms:run) because we have to add an additional parameter ("hostname"); and thissetNamemade our command unavailable as the original one took precendence.And there is also some extra logic regarding aliases in the constructor that is not executed in this case, but we don't need that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh damn, good point.