diff --git a/docs/docs/index.md b/docs/docs/index.md index 5a1fac6..b2fd645 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -38,11 +38,11 @@ q = Queue(connection=redis_conn) # no args implies the default queue # Delay execution of count_words_at_url('http://nvie.com') job = q.enqueue(count_words_at_url, 'http://nvie.com') -print job.result # => None +print(job.result) # => None # Now, wait a while, until the worker is finished time.sleep(2) -print job.result # => 889 +print(job.result) # => 889 {% endhighlight %} If you want to put the work on a specific queue, simply specify its name: @@ -107,7 +107,7 @@ redis_conn = Redis() q = Queue(connection=redis_conn) # Getting the number of jobs in the queue -print len(q) +print(len(q)) # Retrieving jobs queued_job_ids = q.job_ids # Gets a list of job IDs from the queue @@ -160,7 +160,7 @@ def add(x, y): job = add.delay(3, 4) time.sleep(1) -print job.result +print(job.result) {% endhighlight %} diff --git a/docs/docs/jobs.md b/docs/docs/jobs.md index b8db603..ec829ce 100644 --- a/docs/docs/jobs.md +++ b/docs/docs/jobs.md @@ -20,7 +20,7 @@ from rq import get_current_job def add(x, y): job = get_current_job() - print 'Current job: %s' % (job.id,) + print('Current job: %s' % (job.id,)) return x + y {% endhighlight %} @@ -40,7 +40,7 @@ def add(x, y): job = get_current_job() job.meta['handled_by'] = socket.gethostname() job.save_meta() - + # do more work time.sleep(1) return x + y @@ -65,8 +65,8 @@ job = q.enqueue(count_words_at_url, 'http://nvie.com', ttl=43) ## Failed Jobs -If a job fails and raises an exception, the worker will put the job in a failed job queue. -On the Job instance, the `is_failed` property will be true. To fetch all failed jobs, scan +If a job fails and raises an exception, the worker will put the job in a failed job queue. +On the Job instance, the `is_failed` property will be true. To fetch all failed jobs, scan through the `get_failed_queue()` queue. {% highlight python %} @@ -92,4 +92,4 @@ fq.requeue(job.id) assert fq.count == 0 assert Queue('fake').count == 1 -{% endhighlight %} \ No newline at end of file +{% endhighlight %}