private function saveJobStates()
    {
        $now = time();
        $new_states = [];

        foreach ($this->jobs_run as $job) {
            if ($job->isSuccessful()) {
                $new_states[$job->getId()] = ['state' => 'success', 'last-run' => $now];
                $this->pushExecutedJob($job);
            } else {
                $new_states[$job->getId()] = ['state' => 'failure', 'last-run' => $now, 'error' => $job->getOutput()];
                $this->pushFailedJob($job);
            }
        }

        $saved_states = $this->getJobStates();
        $saved_states->save(array_merge($saved_states->content(), $new_states));
    }
private function saveJobStates()
    {
        $now = time();
        $new_states = [];

        foreach ($this->jobs_run as $job) {
            if ($job->isSuccessful()) {
                $new_states[$job->getId()] = ['state' => 'success', 'last-run' => $now];
                $this->pushExecutedJob($job);
            } else {
                $new_states[$job->getId()] = ['state' => 'failure', 'last-run' => $now, 'error' => $job->getOutput()];
                $this->pushFailedJob($job);
            }
        }

        $saved_states = $this->getJobStates();
        $saved_states->save(array_merge($saved_states->content(), $new_states));
    }
private function saveJobStates ( ) { $ now = time ( ) ; $ new_states = [ ] ; foreach ( $ this -> jobs_run as $ job ) { if ( $ job -> isSuccessful ( ) ) { $ new_states [ $ job -> getId ( ) ] = [ 'state' => 'success' , 'last-run' => $ now ] ; $ this -> pushExecutedJob ( $ job ) ; } else { $ new_states [ $ job -> getId ( ) ] = [ 'state' => 'failure' , 'last-run' => $ now , 'error' => $ job -> getOutput ( ) ] ; $ this -> pushFailedJob ( $ job ) ; } } $ saved_states = $ this -> getJobStates ( ) ; $ saved_states -> save ( array_merge ( $ saved_states -> content ( ) , $ new_states ) ) ; }
Save job states to statys file
Save job states to statys file