Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

dimagi/django-scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

**This repository is fully deprecated. It has been merged with [the cStock codebase](https://github.com/dimagi/logistics).**

This is a generic scheduler for django. It offers a cron-inspired interface
to calling arbitrary functions in python. It was inspired and bulit atop
the rapidsms scheduler module, but has been (mostly) decoupled from 
rapidsms.

It uses a celery periodic task to fire a job once a minute that calls
all database-backed schedules. In order for this to work, both celery and
celerybeat processes must be running.

INSTALL
* Apart from enabling this feature, be sure that your system clock is correct.

NOTES
* Timezone support is minimal, all schedules are assumed to be in UTC. Make 
  sure you manage this appropriately.

FEATURE REQUESTS
* There is currently no good UI for creating schedules. Right now, the easiest
  way to do so is in Python,by creating and saving an EventSchedule module, or 
  through the django admin, which mostly works but can cause occassional errors.
  
Example:

# in mymodule.py

def callback_func(arg):
    print "Scheduler called with %s!" % (arg)

schedule = EventSchedule(callback="mymodue.callback_func", \
                         minutes=[15], hours=ALL_VALUE,
                         callback_args=["foobar"])
schedule.save()

This example will print "Scheduler called with foobar!" every hour at 15 past
the hour.
            

Releases

No releases published

Packages

No packages published