Moving getLatest() before the new build is saved
This commit is contained in:
parent
78dbc592b3
commit
6fcd73a356
|
@ -181,6 +181,8 @@ class Builder implements LoggerAwareInterface
|
||||||
*/
|
*/
|
||||||
public function execute()
|
public function execute()
|
||||||
{
|
{
|
||||||
|
$previous_build = $this->build->getProject()->getLatestBuild();
|
||||||
|
|
||||||
// Update the build in the database, ping any external services.
|
// Update the build in the database, ping any external services.
|
||||||
$this->build->setStatus(Build::STATUS_RUNNING);
|
$this->build->setStatus(Build::STATUS_RUNNING);
|
||||||
$this->build->setStarted(new \DateTime());
|
$this->build->setStarted(new \DateTime());
|
||||||
|
@ -188,7 +190,6 @@ class Builder implements LoggerAwareInterface
|
||||||
$this->build->sendStatusPostback();
|
$this->build->sendStatusPostback();
|
||||||
$success = true;
|
$success = true;
|
||||||
|
|
||||||
$previous_build = $this->build->getProject()->getLatestBuild();
|
|
||||||
if ($previous_build) {
|
if ($previous_build) {
|
||||||
$previous_state = $previous_build->getStatus();
|
$previous_state = $previous_build->getStatus();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue