protected function isLocked(Cron $cron)
    {
        $hourAgo = new \DateTime('-65 minutes');
        if ($cron->getState() === Cron::STATE_RUNNING && $cron->getStartedAt() > $hourAgo) {
            return true;
        }

        return false;
    }
protected function isLocked(Cron $cron)
    {
        $hourAgo = new \DateTime('-65 minutes');
        if ($cron->getState() === Cron::STATE_RUNNING && $cron->getStartedAt() > $hourAgo) {
            return true;
        }

        return false;
    }
protected function isLocked ( Cron $ cron ) { $ hourAgo = new \ DateTime ( '-65 minutes' ) ; if ( $ cron -> getState ( ) === Cron :: STATE_RUNNING && $ cron -> getStartedAt ( ) > $ hourAgo ) { return true ; } return false ; }
Checks if the cronjob is currently locked.

This can be overridden with any other lock check. E.g. usage of Redis in case of a load balanced environment

@param Cron $cron

@return bool
Checks if the cronjob is currently locked .