rq_scheduler/scheduler.py
def enqueue_job(self, job):
        """
        Move a scheduled job to a queue. In addition, it also does puts the job
        back into the scheduler if needed.
        """
        self.log.debug('Pushing {0}({1}) to {2}'.format(job.func_name, job.id, job.origin))

        interval = job.meta.get('interval', None)
        repeat = job.meta.get('repeat', None)
        cron_string = job.meta.get('cron_string', None)
        use_local_timezone = job.meta.get('use_local_timezone', None)

        # If job is a repeated job, decrement counter
        if repeat:
            job.meta['repeat'] = int(repeat) - 1

        queue = self.get_queue_for_job(job)
        queue.enqueue_job(job)
        self.connection.zrem(self.scheduled_jobs_key, job.id)

        if interval:
            # If this is a repeat job and counter has reached 0, don't repeat
            if repeat is not None:
                if job.meta['repeat'] == 0:
                    return
            self.connection.zadd(self.scheduled_jobs_key,
                                  {job.id: to_unix(datetime.utcnow()) + int(interval)})
        elif cron_string:
            # If this is a repeat job and counter has reached 0, don't repeat
            if repeat is not None:
                if job.meta['repeat'] == 0:
                    return
            self.connection.zadd(self.scheduled_jobs_key,
                                  {job.id: to_unix(get_next_scheduled_time(cron_string, use_local_timezone=use_local_timezone))})

        Move a scheduled job to a queue. In addition, it also does puts the job
        back into the scheduler if needed.
        
Move a scheduled job to a queue. In addition, it also does puts the job
back into the scheduler if needed.
Move a scheduled job to a queue . In addition it also does puts the job back into the scheduler if needed .
def enqueue_job(self, job):
        self.log.debug('Pushing {0}({1}) to {2}'.format(job.func_name, job.id, job.origin))
        interval = job.meta.get('interval', None)
        repeat = job.meta.get('repeat', None)
        cron_string = job.meta.get('cron_string', None)
        use_local_timezone = job.meta.get('use_local_timezone', None)
        if repeat:
            job.meta['repeat'] = int(repeat) - 1
        queue = self.get_queue_for_job(job)
        queue.enqueue_job(job)
        self.connection.zrem(self.scheduled_jobs_key, job.id)
        if interval:
            if repeat is not None:
                if job.meta['repeat'] == 0:
                    return
            self.connection.zadd(self.scheduled_jobs_key,
                                  {job.id: to_unix(datetime.utcnow()) + int(interval)})
        elif cron_string:
            if repeat is not None:
                if job.meta['repeat'] == 0:
                    return
            self.connection.zadd(self.scheduled_jobs_key,
                                  {job.id: to_unix(get_next_scheduled_time(cron_string, use_local_timezone=use_local_timezone))})
def enqueue_job ( self , job ) : self . log . debug ( 'Pushing {0}({1}) to {2}' . format ( job . func_name , job . id , job . origin ) ) interval = job . meta . get ( 'interval' , None ) repeat = job . meta . get ( 'repeat' , None ) cron_string = job . meta . get ( 'cron_string' , None ) use_local_timezone = job . meta . get ( 'use_local_timezone' , None ) if repeat : job . meta [ 'repeat' ] = int ( repeat ) - 1 queue = self . get_queue_for_job ( job ) queue . enqueue_job ( job ) self . connection . zrem ( self . scheduled_jobs_key , job . id ) if interval : if repeat is not None : if job . meta [ 'repeat' ] == 0 : return self . connection . zadd ( self . scheduled_jobs_key , { job . id : to_unix ( datetime . utcnow ( ) ) + int ( interval ) } ) elif cron_string : if repeat is not None : if job . meta [ 'repeat' ] == 0 : return self . connection . zadd ( self . scheduled_jobs_key , { job . id : to_unix ( get_next_scheduled_time ( cron_string , use_local_timezone = use_local_timezone ) ) } )
Move a scheduled job to a queue.
Move a scheduled job to a queue .
"""
        Move a scheduled job to a queue. In addition, it also does puts the job
        back into the scheduler if needed.
        """ # If job is a repeated job, decrement counter # If this is a repeat job and counter has reached 0, don't repeat # If this is a repeat job and counter has reached 0, don't repeat
self
job