feat(events): update build event reset to reset everything
Instead of using setType('') to prevent events from triggering, it makes more sense to use reset(). However, reset() didn't properly reset type, resource, deployment, or template. This change makes sure to reset all those private variables.
This commit is contained in:
parent
b9b891a90b
commit
b19efb619b
|
@ -254,7 +254,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId
|
|||
}
|
||||
}
|
||||
|
||||
$queueForBuilds->setType(''); // prevent shutdown hook from triggering again
|
||||
$queueForBuilds->reset(); // prevent shutdown hook from triggering again
|
||||
|
||||
if (!empty($errors)) {
|
||||
throw new Exception(Exception::GENERAL_UNKNOWN, \implode("\n", $errors));
|
||||
|
|
|
@ -122,4 +122,20 @@ class Build extends Event
|
|||
'template' => $this->template
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets event.
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function reset(): self
|
||||
{
|
||||
$this->type = '';
|
||||
$this->resource = null;
|
||||
$this->deployment = null;
|
||||
$this->template = null;
|
||||
parent::reset();
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue