Skip to content

Latest commit

 

History

History
69 lines (55 loc) · 1.65 KB

README.md

File metadata and controls

69 lines (55 loc) · 1.65 KB

pyramid_task_scheduler

Build Status pre-commit Code style: black

Install

install packages pip install pyramid-task-scheduler

or require in setup.py

add the follwing line to your Configuratior section of your pyramid application: e.g

    config = Configurator(settings=settings)
    config.include('pyramid_task_scheduler')  # Add this Line

Modes

json crontab

add the following two lines to your .ini file

pyramid_task_scheduler_mode = json
pyramid_task_scheduler_path = path_to/crontab.json

single cron crontab example:

{
	"cron": [
		{
			"name": "first_cron",
			"import_script": "import_script",
			"exec_func": "function_to_execute",
			"crontab_time": "0 * * * *"
		}
	]
}

multiple crons crontab example:

{
    "cron": [
        {
            "name": "first_cron",
            "import_script": "import_script",
            "exec_func": "function_to_execute",
            "crontab_time": "0 * * * *"
        },
        {
            "name": "second_cron",
            "import_script": "import_script",
            "exec_func": "function_to_execute",
            "crontab_time": "0 * * * *"
        }
    ]   
}

NOTE

this package is alpha experimental. It is recommened to NOT use it for productional environments.