linting some blank lines

This commit is contained in:
Ilan Steemers
2015-07-10 12:14:57 +02:00
parent 90d30e14e8
commit e590628612
6 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,4 @@
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from .tasks import async

View File

@@ -1,4 +1,5 @@
from django.apps import AppConfig
from .conf import Conf

View File

@@ -35,8 +35,6 @@ from django_q.models import Task, Success, Schedule
from django_q.monitor import Status, Stat
class Cluster(object):
def __init__(self, list_key=Conf.Q_LIST):
try:
@@ -450,7 +448,8 @@ def scheduler(list_key=Conf.Q_LIST):
kwargs['list_key'] = list_key
s.task = tasks.async(s.func, *args, **kwargs)
if not s.task:
logger.error(_('{} failed to create a task from schedule {} [{}]').format(current_process().name, s.id), s.func)
logger.error(_('{} failed to create a task from schedule {} [{}]').format(current_process().name, s.id),
s.func)
else:
logger.info(_('{} created a task from schedule {} [{}]').format(current_process().name, s.id, s.func))
s.save()

View File

@@ -64,6 +64,7 @@ class Conf(object):
STOPPED = _('Stopped')
STOPPING = _('Stopping')
# logger
logger = logging.getLogger('django-q')
@@ -90,5 +91,6 @@ def get_redis_client():
return django_redis.get_redis_connection(Conf.DJANGO_REDIS)
return redis.StrictRedis(**Conf.REDIS)
# redis client
redis_client = get_redis_client()

View File

@@ -4,10 +4,12 @@ except ImportError:
import pickle
from django.core import signing
from django_q.conf import Conf
BadSignature = signing.BadSignature
class SignedPackage(object):
"""
Wraps Django's signing module with custom Pickle serializer
@@ -41,4 +43,4 @@ class PickleSerializer(object):
@staticmethod
def loads(data):
return pickle.loads(data)
return pickle.loads(data)

View File

@@ -107,4 +107,3 @@ def _sync(task_id, pack):
result_queue.put('STOP')
cluster.monitor(result_queue)
return task_id