https://github.com/sherin/mani
Distributed cron using redis
https://github.com/sherin/mani
cron python redis scheduler
Last synced: 15 days ago
JSON representation
Distributed cron using redis
- Host: GitHub
- URL: https://github.com/sherin/mani
- Owner: sherin
- License: mit
- Created: 2016-09-02T21:36:56.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-08-09T16:29:47.000Z (almost 6 years ago)
- Last Synced: 2026-06-20T23:22:04.600Z (18 days ago)
- Topics: cron, python, redis, scheduler
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 70
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Mani [](https://travis-ci.org/sherinkurian/mani)
Mani is a distribued cron like scheduler. It uses redis to acquire lock on jobs (ensuring a job runs on one node only) and determining when to run the job next.
🍊 Battle-tested at Instacart
## Installation
`pip install mani`
## Usage
```python
from mani import Mani
clock = Mani("redis://localhost:6379/")
@clock.every(minutes=1)
def foo():
print("running foo every minute")
@clock.every(weeks=1, at="mon 19:00:00")
def bar():
print("running bar every week on monday")
@clock.every(hours=1, at="25:00")
def baz():
print("running baz hourly on the 25th minute"
@clock.every(days=1, at="13:00:00")
def qux():
print("running qux daily at 1 pm")
```
### Run on specific timezone (Respects Daylight Savings 🎉)
```python
import pytz
from mani import Mani
config = {
"timezone": pytz.timezone('US/Pacific')
}
clock = Mani("redis://localhost:6379/", config)
@clock.every(minutes=1)
def foo():
print("running foo every minute")
@clock.every(weeks=1, at="mon 19:00:00")
def bar():
print("running bar every week on monday at 7 pm Pacific time")
```
### ChangeLog
Nov 2018 - Version 0.3 released with Python3 support 🚀