mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
linting some blank lines
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .tasks import async
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
from .conf import Conf
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -107,4 +107,3 @@ def _sync(task_id, pack):
|
||||
result_queue.put('STOP')
|
||||
cluster.monitor(result_queue)
|
||||
return task_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user