#40 qsize not implemented

This commit is contained in:
Ilan
2015-08-04 12:26:23 +02:00
parent ed019634d2
commit af61270f62
4 changed files with 15 additions and 5 deletions
+7 -1
View File
@@ -1,6 +1,6 @@
import logging
from signal import signal
from multiprocessing import cpu_count
from multiprocessing import cpu_count, Queue
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
@@ -63,6 +63,12 @@ class Conf(object):
# The redis stats key
Q_STAT = 'django_q:{}:cluster'.format(PREFIX)
# OSX doesn't implement qsize because of missing sem_getvalue()
try:
QSIZE = Queue().qsize == 0
except NotImplementedError:
QSIZE = False
# Getting the signal names
SIGNAL_NAMES = dict((getattr(signal, n), n) for n in dir(signal) if n.startswith('SIG') and '_' not in n)