mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 08:18:11 +08:00
linting some blank lines
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from .tasks import async
|
from .tasks import async
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
from .conf import Conf
|
from .conf import Conf
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -35,8 +35,6 @@ from django_q.models import Task, Success, Schedule
|
|||||||
from django_q.monitor import Status, Stat
|
from django_q.monitor import Status, Stat
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Cluster(object):
|
class Cluster(object):
|
||||||
def __init__(self, list_key=Conf.Q_LIST):
|
def __init__(self, list_key=Conf.Q_LIST):
|
||||||
try:
|
try:
|
||||||
@@ -450,7 +448,8 @@ def scheduler(list_key=Conf.Q_LIST):
|
|||||||
kwargs['list_key'] = list_key
|
kwargs['list_key'] = list_key
|
||||||
s.task = tasks.async(s.func, *args, **kwargs)
|
s.task = tasks.async(s.func, *args, **kwargs)
|
||||||
if not s.task:
|
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:
|
else:
|
||||||
logger.info(_('{} created a task from schedule {} [{}]').format(current_process().name, s.id, s.func))
|
logger.info(_('{} created a task from schedule {} [{}]').format(current_process().name, s.id, s.func))
|
||||||
s.save()
|
s.save()
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ class Conf(object):
|
|||||||
STOPPED = _('Stopped')
|
STOPPED = _('Stopped')
|
||||||
STOPPING = _('Stopping')
|
STOPPING = _('Stopping')
|
||||||
|
|
||||||
|
|
||||||
# logger
|
# logger
|
||||||
logger = logging.getLogger('django-q')
|
logger = logging.getLogger('django-q')
|
||||||
|
|
||||||
@@ -90,5 +91,6 @@ def get_redis_client():
|
|||||||
return django_redis.get_redis_connection(Conf.DJANGO_REDIS)
|
return django_redis.get_redis_connection(Conf.DJANGO_REDIS)
|
||||||
return redis.StrictRedis(**Conf.REDIS)
|
return redis.StrictRedis(**Conf.REDIS)
|
||||||
|
|
||||||
|
|
||||||
# redis client
|
# redis client
|
||||||
redis_client = get_redis_client()
|
redis_client = get_redis_client()
|
||||||
|
|||||||
+3
-1
@@ -4,10 +4,12 @@ except ImportError:
|
|||||||
import pickle
|
import pickle
|
||||||
|
|
||||||
from django.core import signing
|
from django.core import signing
|
||||||
|
|
||||||
from django_q.conf import Conf
|
from django_q.conf import Conf
|
||||||
|
|
||||||
BadSignature = signing.BadSignature
|
BadSignature = signing.BadSignature
|
||||||
|
|
||||||
|
|
||||||
class SignedPackage(object):
|
class SignedPackage(object):
|
||||||
"""
|
"""
|
||||||
Wraps Django's signing module with custom Pickle serializer
|
Wraps Django's signing module with custom Pickle serializer
|
||||||
@@ -41,4 +43,4 @@ class PickleSerializer(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def loads(data):
|
def loads(data):
|
||||||
return pickle.loads(data)
|
return pickle.loads(data)
|
||||||
|
|||||||
@@ -107,4 +107,3 @@ def _sync(task_id, pack):
|
|||||||
result_queue.put('STOP')
|
result_queue.put('STOP')
|
||||||
cluster.monitor(result_queue)
|
cluster.monitor(result_queue)
|
||||||
return task_id
|
return task_id
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user