src/Model/Package.php
public function requireDefaultRecords()
    {
        parent::requireDefaultRecords();

        $pendingJobs = QueuedJobDescriptor::get()->filter([
            'Implementation' => CheckForUpdatesJob::class,
            'JobStatus' => [
                QueuedJob::STATUS_NEW,
                QueuedJob::STATUS_INIT,
                QueuedJob::STATUS_RUN,
            ],
        ]);
        if ($pendingJobs->count()) {
            return;
        }

        /** @var QueuedJobService $jobService */
        $jobService = QueuedJobService::singleton();
        $jobService->queueJob(Injector::inst()->create(CheckForUpdatesJob::class));
    }
public function requireDefaultRecords()
    {
        parent::requireDefaultRecords();

        $pendingJobs = QueuedJobDescriptor::get()->filter([
            'Implementation' => CheckForUpdatesJob::class,
            'JobStatus' => [
                QueuedJob::STATUS_NEW,
                QueuedJob::STATUS_INIT,
                QueuedJob::STATUS_RUN,
            ],
        ]);
        if ($pendingJobs->count()) {
            return;
        }

        /** @var QueuedJobService $jobService */
        $jobService = QueuedJobService::singleton();
        $jobService->queueJob(Injector::inst()->create(CheckForUpdatesJob::class));
    }
public function requireDefaultRecords ( ) { parent :: requireDefaultRecords ( ) ; $ pendingJobs = QueuedJobDescriptor :: get ( ) -> filter ( [ 'Implementation' => CheckForUpdatesJob :: class , 'JobStatus' => [ QueuedJob :: STATUS_NEW , QueuedJob :: STATUS_INIT , QueuedJob :: STATUS_RUN , ] , ] ) ; if ( $ pendingJobs -> count ( ) ) { return ; } /** @var QueuedJobService $jobService */ $ jobService = QueuedJobService :: singleton ( ) ; $ jobService -> queueJob ( Injector :: inst ( ) -> create ( CheckForUpdatesJob :: class ) ) ; }
Queue up a job to check for updates to packages if there isn't a pending job in the queue already
Queue up a job to check for updates to packages if there isn t a pending job in the queue already