示例#1
0
    def handle(self, *commands, **options):

        verbosity = options.get('verbosity', 1)
        server = options.get('server', False)

        if not settings.GEARMAN_SERVERS:
            logging.error("No gearman servers configured")
            return

        if server:
            Server(verbosity).start()

        worker = create_worker()
        if verbosity > 0:
            logging.info("Starting workers: " + ', '.join(worker.abilities.keys()))
        worker.work()
示例#2
0
    def handle(self, *commands, **options):

        verbosity = options.get('verbosity', 1)
        server = options.get('server', False)

        if not settings.GEARMAN_SERVERS:
            logging.error("No gearman servers configured")
            return

        if server:
            Server(verbosity).start()

            # Restart incomplete jobs
            for job in JobInfo.objects.filter(completed=False):
                job.run()

        worker = create_worker()
        logging.debug("Starting workers: " + ', '.join(worker.abilities.keys()))
        worker.work()
        logging.debug("Workers finished, exiting")
示例#3
0
    def handle(self, *commands, **options):

        verbosity = options.get('verbosity', 1)
        server = options.get('server', False)

        if not settings.GEARMAN_SERVERS:
            logging.error("No gearman servers configured")
            return

        if server:
            Server(verbosity).start()

            # Restart incomplete jobs
            for job in JobInfo.objects.filter(completed=False):
                job.run()

        worker = create_worker()
        if verbosity > 0:
            logging.info("Starting workers: " +
                         ', '.join(worker.abilities.keys()))
        worker.work()