rq / rq-scheduler

A lightweight library that adds job scheduling capabilities to RQ (Redis Queue)
MIT License
1.45k stars 230 forks source link

get_status for job not updating? #288

Open ansocha opened 1 year ago

ansocha commented 1 year ago

Don't know why, but I always get None for job.get_status()

When I iterate through jobs in the queue. The job is scheduled and runs and I get the job ID with job.id.

But get_status and all these are always False is_started, is_failed, is_queued, is_scheduled, etc...

So I schedule the job in the queue:

job = scheduler.enqueue_in(timedelta(seconds=15), someFunc)

Then when I iterate through all jobs in the queue it always gives me None for get_status

Within I should get True for is_scheduled no?

        list_of_job_instances = scheduler.get_jobs()
        for j in list_of_job_instances:
            print(j.get_status())#None

I've tried this many ways and don't know what I'm missing or if this is a bug. Agan I confirm the job is scheduled and is_scheduled still gets me False and get_status gives me None for the job:

            list_of_job_instances = scheduler.get_jobs()
            for job in list_of_job_instances:
                if job in scheduler:
                                     print('Job is in scheduler')# this is fine
unicodeee commented 1 year ago

I have this same issue.