public function isQueued(string $alias): bool
    {
        $query = $this->createQueryBuilder('c')
            ->where('c.alias = :alias')
            ->andWhere('c.ended is NULL')
            ->setParameter('alias', $alias)
            ->getQuery();

        try {
            $result = $query->setMaxResults(1)->getOneOrNullResult();
            if ($result) {
                return true;
            }
        } catch (NonUniqueResultException $e) {
            return false;
        }

        return false;
    }
public function isQueued(string $alias): bool
    {
        $query = $this->createQueryBuilder('c')
            ->where('c.alias = :alias')
            ->andWhere('c.ended is NULL')
            ->setParameter('alias', $alias)
            ->getQuery();

        try {
            $result = $query->setMaxResults(1)->getOneOrNullResult();
            if ($result) {
                return true;
            }
        } catch (NonUniqueResultException $e) {
            return false;
        }

        return false;
    }
public function isQueued ( string $ alias ) : bool { $ query = $ this -> createQueryBuilder ( 'c' ) -> where ( 'c.alias = :alias' ) -> andWhere ( 'c.ended is NULL' ) -> setParameter ( 'alias' , $ alias ) -> getQuery ( ) ; try { $ result = $ query -> setMaxResults ( 1 ) -> getOneOrNullResult ( ) ; if ( $ result ) { return true ; } } catch ( NonUniqueResultException $ e ) { return false ; } return false ; }
Identify of cron command is queued.

@param string $alias cron alias

@return bool true if cron is already queued
Identify of cron command is queued .