Skip to content
Distributed cron using redis
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mani
test
.gitignore
.travis.yml
LICENSE.txt
README.md
example.py
requirements.txt
setup.cfg
setup.py

README.md

Mani Build Status

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

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 🎉)

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 🚀

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.