• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. Review Bot 3.0
    2. Version 4.x
    3. Version 3.0
    4. Version 2.0
    5. Version 1.0
    6. Module and Class Reference
    7. reviewbot.celery
  • Home
  • Installation
  • Manually Installing Review Bot
  • Review Bot Docker Images
  • Upgrading Review Bot
  • Configuring Review Bot
  • Review Bot Tools
  • Cargo Tool
  • Checkstyle
  • Clang Static Analyzer
  • Cppcheck
  • Cpplint
  • Doc8
  • FBInfer
  • Flake8
  • Go Fmt
  • Go Tool
  • JSHint
  • PMD
  • Pycodestyle
  • Pydocstyle
  • Pyflakes
  • RuboCop
  • Rust Fmt
  • Secret Scanner
  • ShellCheck
  • Module and Class Reference
  • reviewbot.tools.base
  • reviewbot.tools.base.mixins
  • reviewbot.tools.base.registry
  • reviewbot.tools.base.tool
  • reviewbot.testing.testcases
  • reviewbot.testing.utils
  • reviewbot.tools.testing
  • reviewbot.tools.testing.decorators
  • reviewbot.tools.testing.testcases
  • reviewbot.processing.review
  • reviewbot.utils.api
  • reviewbot.utils.filesystem
  • reviewbot.utils.log
  • reviewbot.utils.process
  • reviewbot.utils.text
  • reviewbot.celery
  • reviewbot.config
  • reviewbot.deprecation
  • reviewbot.errors
  • reviewbot.repositories
  • reviewbot.tasks
  • reviewbot.tools.cargotool
  • reviewbot.tools.checkstyle
  • reviewbot.tools.clang
  • reviewbot.tools.cppcheck
  • reviewbot.tools.cpplint
  • reviewbot.tools.doc8
  • reviewbot.tools.fbinfer
  • reviewbot.tools.flake8
  • reviewbot.tools.gofmt
  • reviewbot.tools.gotool
  • reviewbot.tools.jshint
  • reviewbot.tools.pmd
  • reviewbot.tools.pycodestyle
  • reviewbot.tools.pydocstyle
  • reviewbot.tools.pyflakes
  • reviewbot.tools.rbsecretscanner
  • reviewbot.tools.rubocop
  • reviewbot.tools.rustfmt
  • reviewbot.tools.shellcheck
  • General Index
  • Python Module Index
  • Release Notes
  • This documentation covers Review Bot 3.0. You can select a version above or view the latest documentation.

    reviewbot.celery¶

    Celery and Review Bot worker setup and management.

    Functions

    create_queues(hostname)

    Create the celery queues.

    get_celery()

    Return a Celery instance.

    setup_cookies()

    Set up cookie storage for API communication.

    setup_logging(instance, conf, **kwargs)

    Set up logging for Celery and Review Bot.

    setup_reviewbot(instance, conf, **kwargs)

    Set up Review Bot and Celery.

    start_worker(broker, hostname, loglevel, ...)

    Start a worker.

    Classes

    ReviewBotCelery()

    A Celery specialization for Review Bot.

    class ReviewBotCelery[source]¶

    Bases: Celery

    A Celery specialization for Review Bot.

    This takes care of initializing Celery with the right options.

    New in version 3.0.

    __init__()[source]¶

    Initialize Celery.

    create_queues(hostname)[source]¶

    Create the celery queues.

    Returns:

    The queues that this worker will listen to.

    Return type:

    list of kombu.Queue

    setup_cookies()[source]¶

    Set up cookie storage for API communication.

    This will ensure that the cookie directory exists and that the cookie file can be written to.

    Raises:

    IOError – The cookie directories could not be created or there’s a permission error with cookie storage. The specific error will be in the exception message.

    setup_logging(instance, conf, **kwargs)[source]¶

    Set up logging for Celery and Review Bot.

    This will configure the log formats we want Celery to use. This differs from Celery’s defaults not just in the structure of the log entries, but also in the addition of the logger name (used to identify different tools).

    Parameters:
    • instance (celery.app.base.Celery) – The Celery instance.

    • conf (celery.app.utils.Settings) – The Celery configuration.

    • **kwargs (dict, unused) – Additional keyword arguments passed to the signal.

    setup_reviewbot(instance, conf, **kwargs)[source]¶

    Set up Review Bot and Celery.

    This will load the Review Bot configuration, store any repository state, and set up the queues for the enabled tools.

    Parameters:
    • instance (celery.app.base.Celery) – The Celery instance.

    • conf (celery.app.utils.Settings) – The Celery configuration.

    • **kwargs (dict, unused) – Additional keyword arguments passed to the signal.

    get_celery()[source]¶

    Return a Celery instance.

    This will only be constructed the first time this is called. All subsequent calls will reuse a cached instance.

    New in version 3.0.

    Returns:

    The Celery instance.

    Return type:

    ReviewBotCelery

    start_worker(broker, hostname, loglevel, logfile, detach, pidfile, uid, gid, umask, concurrency, pool_cls, autoscale)[source]¶

    Start a worker.

    This will take in the requested arguments and start a Celery worker, running either in the current process or in a detached process.

    This also takes care to patch the concurrency module, as per Celery’s requirements, and to drop privileges if needed.

    New in version 3.0.

    Parameters:
    • broker (unicode) – The broker URI.

    • hostname (unicode) – The local hostname Review Bot will identify with when talking to the broker.

    • loglevel (unicode) – The minimum log level.

    • logfile (unicode) – The path to a log file to write to.

    • detach (bool) – Whether to run the worker in a detached process.

    • pidfile (unicode) – The path to a PID file to write to when detaching.

    • uid (unicode) – The user ID to use when detaching.

    • gid (unicode) – The group ID to use when detaching.

    • umask (unicode) – The umask (in octal string format) to use for the process when detaching.

    • concurrency (int) – The number of concurrent processes to run.

    • pool_cls (unicode) – The pool implementation.

    • autoscale (unicode) – The autoscale settings, in the form of max_concurrency,min_concurrency.

    Returns:

    The worker’s exit code.

    Return type:

    int

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]
    • ReviewBotCelery
      • ReviewBotCelery.__init__()
    • create_queues()
    • setup_cookies()
    • setup_logging()
    • setup_reviewbot()
    • get_celery()
    • start_worker()