def main(): utils.setup_logging() config.log() gh_pr.monkeypatch_github() if config.FLUSH_REDIS_ON_STARTUP: utils.get_redis().flushall() with rq.Connection(utils.get_redis()): worker = rq.Worker(['default']) worker.work()
def main(): utils.setup_logging() gh_pr.monkeypatch_github() if config.FLUSH_REDIS_ON_STARTUP: utils.get_redis().flushall() with rq.Connection(utils.get_redis()): worker = rq.worker.HerokuWorker([rq.Queue('default')], exception_handlers=[error_handler]) worker.work()
def main(): # pragma: no cover utils.setup_logging() config.log() gh_pr.monkeypatch_github() r = utils.get_redis_for_rq() if config.FLUSH_REDIS_ON_STARTUP: r.flushall() with rq.Connection(r): worker = rq.Worker(['default']) if config.SENTRY_URL: client = raven.Client(config.SENTRY_URL, transport=HTTPTransport) register_sentry(client, worker) worker.work()
def main(): # pragma: no cover parser = argparse.ArgumentParser(description='Mergify RQ Worker.') parser.add_argument('--fqdn', help='FQDN of the node', default=utils.get_fqdn()) parser.add_argument("worker_id", type=int, help='Worker ID') args = parser.parse_args() sentry_client = utils.prepare_service() worker = MergifyWorker(args.fqdn, args.worker_id) if sentry_client: register_sentry(sentry_client, worker) worker.work()