From 5289647970b6b6070447743eb8defeb854b41e42 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Sat, 23 Feb 2013 22:05:28 +0100 Subject: [PATCH] Remove unused import. --- rq/worker.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rq/worker.py b/rq/worker.py index 4a66686..8f1da27 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -13,7 +13,6 @@ import socket import signal import traceback import logging -from cPickle import dumps from .queue import Queue, get_failed_queue from .connections import get_current_connection from .job import Job, Status @@ -199,7 +198,7 @@ class Worker(object): key = self.key now = time.time() queues = ','.join(self.queue_names()) - with self.connection.pipeline() as p: + with self.connection._pipeline() as p: p.delete(key) p.hset(key, 'birth', now) p.hset(key, 'queues', queues) @@ -210,7 +209,7 @@ class Worker(object): def register_death(self): """Registers its own death.""" self.log.debug('Registering death') - with self.connection.pipeline() as p: + with self.connection._pipeline() as p: # We cannot use self.state = 'dead' here, because that would # rollback the pipeline p.srem(self.redis_workers_keys, self.key) @@ -415,9 +414,9 @@ class Worker(object): job._result = rv job._status = Status.FINISHED job.ended_at = times.now() - + result_ttl = job.get_ttl(self.default_result_ttl) - pipeline = self.connection.pipeline() + pipeline = self.connection._pipeline() if result_ttl != 0: job.save(pipeline=pipeline) job.cleanup(result_ttl, pipeline=pipeline)