addons14/queue_job/job.py
def enqueue(
        cls,
        func,
        args=None,
        kwargs=None,
        priority=None,
        eta=None,
        max_retries=None,
        description=None,
        channel=None,
        identity_key=None,
    ):
        """Create a Job and enqueue it in the queue. Return the job uuid.

        This expects the arguments specific to the job to be already extracted
        from the ones to pass to the job function.

        If the identity key is the same than the one in a pending job,
        no job is created and the existing job is returned

        """
        new_job = cls(
            func=func,
            args=args,
            kwargs=kwargs,
            priority=priority,
            eta=eta,
            max_retries=max_retries,
            description=description,
            channel=channel,
            identity_key=identity_key,
        )
        if new_job.identity_key:
            existing = new_job.job_record_with_same_identity_key()
            if existing:
                _logger.debug(
                    "a job has not been enqueued due to having "
                    "the same identity key (%s) than job %s",
                    new_job.identity_key,
                    existing.uuid,
                )
                return Job._load_from_db_record(existing)
        new_job.store()
        _logger.debug(
            "enqueued %s:%s(*%r, **%r) with uuid: %s",
            new_job.recordset,
            new_job.method_name,
            new_job.args,
            new_job.kwargs,
            new_job.uuid,
        )
        return new_job
Create a Job and enqueue it in the queue. Return the job uuid.

        This expects the arguments specific to the job to be already extracted
        from the ones to pass to the job function.

        If the identity key is the same than the one in a pending job,
        no job is created and the existing job is returned

        
Create a Job and enqueue it in the queue. Return the job uuid.
This expects the arguments specific to the job to be already extracted
from the ones to pass to the job function.

If the identity key is the same than the one in a pending job,
no job is created and the existing job is returned
Create a Job and enqueue it in the queue . Return the job uuid . This expects the arguments specific to the job to be already extracted from the ones to pass to the job function . If the identity key is the same than the one in a pending job no job is created and the existing job is returned
def enqueue(
        cls,
        func,
        args=None,
        kwargs=None,
        priority=None,
        eta=None,
        max_retries=None,
        description=None,
        channel=None,
        identity_key=None,
    ):
        new_job = cls(
            func=func,
            args=args,
            kwargs=kwargs,
            priority=priority,
            eta=eta,
            max_retries=max_retries,
            description=description,
            channel=channel,
            identity_key=identity_key,
        )
        if new_job.identity_key:
            existing = new_job.job_record_with_same_identity_key()
            if existing:
                _logger.debug(
                    "a job has not been enqueued due to having "
                    "the same identity key (%s) than job %s",
                    new_job.identity_key,
                    existing.uuid,
                )
                return Job._load_from_db_record(existing)
        new_job.store()
        _logger.debug(
            "enqueued %s:%s(*%r, **%r) with uuid: %s",
            new_job.recordset,
            new_job.method_name,
            new_job.args,
            new_job.kwargs,
            new_job.uuid,
        )
        return new_job
def enqueue ( cls , func , args = None , kwargs = None , priority = None , eta = None , max_retries = None , description = None , channel = None , identity_key = None , ) : new_job = cls ( func = func , args = args , kwargs = kwargs , priority = priority , eta = eta , max_retries = max_retries , description = description , channel = channel , identity_key = identity_key , ) if new_job . identity_key : existing = new_job . job_record_with_same_identity_key ( ) if existing : _logger . debug ( "a job has not been enqueued due to having " "the same identity key (%s) than job %s" , new_job . identity_key , existing . uuid , ) return Job . _load_from_db_record ( existing ) new_job . store ( ) _logger . debug ( "enqueued %s:%s(*%r, **%r) with uuid: %s" , new_job . recordset , new_job . method_name , new_job . args , new_job . kwargs , new_job . uuid , ) return new_job
Create a Job and enqueue it in the queue.
Create a Job and enqueue it in the queue .
"""Create a Job and enqueue it in the queue. Return the job uuid.

        This expects the arguments specific to the job to be already extracted
        from the ones to pass to the job function.

        If the identity key is the same than the one in a pending job,
        no job is created and the existing job is returned

        """
cls
func
args
kwargs
priority
eta
max_retries
description
channel
identity_key