Project Links

Meta

Maintainers

Project Description

Krux Python class built on top of [Krux Stdlib](https://staticfiles.krxd.net/foss/docs/pypi/krux-stdlib/) for interacting with [APScheduler](http://pythonhosted.org//APScheduler/)

Application quick start-----------------------

The most common use case for this library is to run a job periodically from a script.To do that, do the following:

```python

import timefrom krux_scheduler import Application

def main(): ### The name must be unique to the organization. The object ### returned inherits from krux.cli.Application, so it provides ### all that functionality as well. app = Application( name = 'krux-my-periodic-job' )

### This is the scheduler object, which behaves exactly ### like an APScheduler object, but with logging, stats ### and CLI support added. scheduler = app.scheduler

scheduler: --scheduler-minute SCHEDULER_MINUTE Comma separated list of minute mark(s) to run on. This overrides any hardcoded arguments (default: None) --scheduler-hour SCHEDULER_HOUR Comma separated list of hour mark(s) to run on. This overrides any hardcoded arguments (default: None) --scheduler-daemonize Run scheduled jobs in separate threads (default: False) --scheduler-exit-after-job Exit the application after a job has completed. Very useful for RAM hungry applications whose only purpose is to run a single job but not otherwise. Requires a process monitor to restart if it exits (default: False)```