From a87bc8a9b2d78e787362f9ad5341f1c9776f68c1 Mon Sep 17 00:00:00 2001 From: Stepan Strelets Date: Thu, 30 Mar 2017 23:26:35 +0300 Subject: [PATCH] Add unset build log - implicit flush buffer --- src/PHPCensor/Command/RunCommand.php | 2 ++ src/PHPCensor/Worker/BuildWorker.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/PHPCensor/Command/RunCommand.php b/src/PHPCensor/Command/RunCommand.php index 0729db05..afe4e62b 100644 --- a/src/PHPCensor/Command/RunCommand.php +++ b/src/PHPCensor/Command/RunCommand.php @@ -118,6 +118,8 @@ class RunCommand extends Command // After execution we no longer want to record the information // back to this specific build so the handler should be removed. $this->logger->popHandler(); + // destructor implicitly call flush + unset($buildDbLog); } catch (\Exception $ex) { $build->setStatus(Build::STATUS_FAILED); $build->setFinished(new \DateTime()); diff --git a/src/PHPCensor/Worker/BuildWorker.php b/src/PHPCensor/Worker/BuildWorker.php index 10066d0e..326b3258 100644 --- a/src/PHPCensor/Worker/BuildWorker.php +++ b/src/PHPCensor/Worker/BuildWorker.php @@ -121,6 +121,8 @@ class BuildWorker // After execution we no longer want to record the information // back to this specific build so the handler should be removed. $this->logger->popHandler(); + // destructor implicitly call flush + unset($buildDbLog); } catch (\PDOException $ex) { // If we've caught a PDO Exception, it is probably not the fault of the build, but of a failed // connection or similar. Release the job and kill the worker.