mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-06 09:28:13 +08:00
Fixes merge conflicts
This commit is contained in:
@@ -3,7 +3,7 @@ from django.utils.translation import ugettext as _
|
|||||||
|
|
||||||
from django_q import VERSION
|
from django_q import VERSION
|
||||||
from django_q.conf import Conf
|
from django_q.conf import Conf
|
||||||
from django_q.monitor import info
|
from django_q.monitor import info, get_ids
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
@@ -18,9 +18,18 @@ class Command(BaseCommand):
|
|||||||
default=False,
|
default=False,
|
||||||
help='Print current configuration.',
|
help='Print current configuration.',
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--ids',
|
||||||
|
action='store_true',
|
||||||
|
dest='ids',
|
||||||
|
default=False,
|
||||||
|
help='Print cluster task ID(s) (PIDs).',
|
||||||
|
)
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
if options.get('config', False):
|
if options.get('ids', True):
|
||||||
|
get_ids()
|
||||||
|
elif options.get('config', False):
|
||||||
hide = ['conf', 'IDLE', 'STOPPING', 'STARTING', 'WORKING', 'SIGNAL_NAMES', 'STOPPED']
|
hide = ['conf', 'IDLE', 'STOPPING', 'STARTING', 'WORKING', 'SIGNAL_NAMES', 'STOPPED']
|
||||||
settings = [a for a in dir(Conf) if not a.startswith('__') and a not in hide]
|
settings = [a for a in dir(Conf) if not a.startswith('__') and a not in hide]
|
||||||
self.stdout.write('VERSION: {}'.format('.'.join(str(v) for v in VERSION)))
|
self.stdout.write('VERSION: {}'.format('.'.join(str(v) for v in VERSION)))
|
||||||
|
|||||||
@@ -187,3 +187,14 @@ def info(broker=None):
|
|||||||
term.white('{0:.4f}'.format(exec_time))
|
term.white('{0:.4f}'.format(exec_time))
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def get_ids():
|
||||||
|
# prints id (PID) of running clusters
|
||||||
|
stat = Stat.get_all()
|
||||||
|
if stat:
|
||||||
|
for s in stat:
|
||||||
|
print(s.cluster_id)
|
||||||
|
else:
|
||||||
|
print('No clusters appear to be running.')
|
||||||
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user