parser.add_argument('--path','-P',default='.',help='Specify the import path.')
parser.add_argument('--interval','-i',metavar='N',type=float,default=2.5,help='Updates stats every N seconds (default: don\'t poll)')
parser.add_argument('--raw','-r',action='store_true',default=False,help='Print only the raw numbers, no bar charts')
parser.add_argument('--only-queues','-Q',dest='only_queues',default=False,action='store_true',help='Show only queue info')
parser.add_argument('--only-workers','-W',dest='only_workers',default=False,action='store_true',help='Show only worker info')
parser.add_argument('--by-queue','-R',dest='by_queue',default=False,action='store_true',help='Shows workers by queue')
parser.add_argument('--interval','-i',metavar='N',type=float,default=2.5,help='Updates stats every N seconds (default: don\'t poll)')# noqa
parser.add_argument('--raw','-r',action='store_true',default=False,help='Print only the raw numbers, no bar charts')# noqa
parser.add_argument('--only-queues','-Q',dest='only_queues',default=False,action='store_true',help='Show only queue info')# noqa
parser.add_argument('--only-workers','-W',dest='only_workers',default=False,action='store_true',help='Show only worker info')# noqa
parser.add_argument('--by-queue','-R',dest='by_queue',default=False,action='store_true',help='Shows workers by queue')# noqa
parser.add_argument('--empty-failed-queue','-X',dest='empty_failed_queue',default=False,action='store_true',help='Empties the failed queue, then quits')# noqa
parser.add_argument('queues',nargs='*',help='The queues to poll')
returnparser.parse_args()
@ -173,15 +176,20 @@ def main():
setup_default_arguments(args,settings)
setup_redis(args)
try:
ifargs.only_queues:
func=show_queues
elifargs.only_workers:
func=show_workers
ifargs.empty_failed_queue:
num_jobs=get_failed_queue().empty()
print('{} jobs removed from failed queue'.format(num_jobs))