Pantheon\Terminus\Models\Workflow::checkProgress PHP Method

checkProgress() public method

Check on the progress of a workflow. This can be called repeatedly and will apply a polling period to prevent flooding the API with requests.
public checkProgress ( ) : boolean
return boolean Whether the workflow is finished or not
    public function checkProgress()
    {
        // Fetch the workflow status from the API.
        $this->poll();
        if ($this->isFinished()) {
            // If the workflow failed then figure out the correct output message and throw an exception.
            if (!$this->isSuccessful()) {
                throw new TerminusException($this->getMessage());
            }
            return true;
        }
        return false;
    }