Skip to content

Commit

Permalink
Merge pull request #63 from neighborhoods/KOJO-82-add-error-get-last-…
Browse files Browse the repository at this point in the history
…to-shutdown-event

KOJO-82 | Add error_get_last() to shutdown event
  • Loading branch information
mucha55 authored Mar 29, 2019
2 parents de61d89 + 80f80dd commit 5b3b8e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ProcessAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ public function exit(): void
public function shutdown(): ProcessInterface
{
if ($this->_read(self::PROP_IS_SHUTDOWN_METHOD_ACTIVE)) {
$this->_getLogger()->critical("Shutdown method invoked.");
// to avoid hitting artificial memory limits while executing this block
ini_set('memory_limit','-1');
$this->_getLogger()->critical(
'Shutdown method invoked.',
['potentially_unrelated_error_get_last' => error_get_last()]
);
$this->_setOrReplaceExitCode(255);
$this->exit();
}
Expand Down

0 comments on commit 5b3b8e3

Please sign in to comment.