Skip to main content

A Celery Beat Scheduler that uses MongoDB to store both schedule definitions and status information

Project description

This is a Celery Beat Scheduler (http://celery.readthedocs.org/en/latest/userguide/periodic-tasks.html) that stores both the schedules themselves and their status information in a backend Mongo database. It can be installed by installing the celerybeat-mongo Python egg:

# pip install celerybeat-mongo

And specifying the scheduler when running Celery Beat, e.g.:

$ celery beat -S celerybeatmongo.schedulers.MongoScheduler

Settings for the scheduler are defined in your celery configuration file similar to how other aspects of Celery are configured:

CELERY_MONGODB_SCHEDULER_DB = "celery"
CELERY_MONGODB_SCHEDULER_COLLECTION = "schedules"
CELERY_MONGODB_SCHEDULER_URL = "mongodb://userid:password@hostname:port"

If not settings are specified, the library will attempt to use the schedules collection in the local celery database.

Schedules can be manipulated in the Mongo database using the mongoengine models in celerybeatmongo.models or through direct database manipulation. There exist two types of schedules, interval and crontab.

Interval:

{
    "_id" : ObjectId("533c5b29b45a2092bffceb13"),
    "name" : "interval test schedule",
    "task" : "task-name-goes-here",
    "enabled" : true,
    "interval" : {
        "every" : 5,
        "period" : "minutes"
    },
    "args" : [
        "param1",
        "param2"
    ],
    "kwargs" : {
        "max_targets" : 100
    },
    "total_run_count" : 5,
    "last_run_at" : ISODate("2014-04-03T19:19:22.666+17:00")
}

Crontab:

{
    "_id" : ObjectId("53a91dfd455d1c1a4345fb59"),
    "name" : "crontab test schedule",
    "task" : "task-name-goes-here",
    "enabled" : true,
    "crontab" : {
        "minute" : "30",
        "hour" : "2",
        "day_of_week" : "*",
        "day_of_month" : "*",
        "day_of_year" : "*"
    },
    "args" : [
        "param1",
        "param2"
    ],
    "kwargs" : {
        "max_targets" : 100
    },
    "total_run_count" : 5,
    "last_run_at" : ISODate("2014-04-03T19:19:22.666+17:00")
}

The following fields are required: name, task, crontab || interval, enabled when defining new tasks. total_run_count and last_run_at are maintained by the scheduler and should not be externally manipulated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

celerybeat-mongo-0.0.5.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

celerybeat-mongo-0.0.5.macosx-10.9-intel.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file celerybeat-mongo-0.0.5.tar.gz.

File metadata

File hashes

Hashes for celerybeat-mongo-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0605c1791c297dce6bb32d9c3c8498318e04915a84f5b22cf7f1a80af991f297
MD5 6820f0a590f273853b9606ff6215ddb5
BLAKE2b-256 3c088ccb22d94817b17fd11ddfea18d014699877a308d812664fbab348268b11

See more details on using hashes here.

File details

Details for the file celerybeat-mongo-0.0.5.macosx-10.9-intel.tar.gz.

File metadata

File hashes

Hashes for celerybeat-mongo-0.0.5.macosx-10.9-intel.tar.gz
Algorithm Hash digest
SHA256 c7c320746894e7b3abe2080b322364e2c6e5bce72d642c99708a68d84a3fefe5
MD5 4a2fb783029c94a0e4386fb10db800ba
BLAKE2b-256 9a3e2a966053d7da7119926b3787605bff932d5dc2b02340c3a51ff2efad9031

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page