mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 11:38:12 +08:00
adds qinfo management command
It seems more practical to give this its own command instead of `qmonitor --info`
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django_q.monitor import info
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
# Translators: help text for qinfo management command
|
||||
help = _('General information over all clusters.')
|
||||
|
||||
def handle(self, *args, **options):
|
||||
info()
|
||||
@@ -1,10 +1,9 @@
|
||||
# Django
|
||||
from optparse import make_option
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django_q.monitor import monitor, info
|
||||
from django_q.monitor import monitor
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
@@ -17,16 +16,7 @@ class Command(BaseCommand):
|
||||
dest='run_once',
|
||||
default=False,
|
||||
help='Run once and then stop.'),
|
||||
make_option('-i', '--info',
|
||||
action='store_true',
|
||||
dest='info',
|
||||
default=False,
|
||||
help='Lists general information over all clusters. ')
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
if options.get('info', False):
|
||||
info()
|
||||
else:
|
||||
monitor(run_once=options.get('run_once', False))
|
||||
|
||||
monitor(run_once=options.get('run_once', False))
|
||||
|
||||
Reference in New Issue
Block a user