Example #1
0
def run_cron_with_cache_check(cron_class, force=False, silent=False):
    """
    Checks the cache and runs the cron or not.

    @cron_class - cron class to run.
    @force      - run job even if not scheduled
    @silent     - suppress notifications
    """

    with CronJobManager(cron_class, silent) as manager:
        manager.run(force)
Example #2
0
def run_cron_with_cache_check(
    cron_class, force=False, silent=False, dry_run=False, stdout=None
):
    """
    Checks the cache and runs the cron or not.

    @cron_class - cron class to run.
    @force      - run job even if not scheduled
    @silent     - suppress notifications
    @dryrun     - don't actually perform the cron job
    @stdout     - where to write feedback to
    """
    with CronJobManager(cron_class, silent=silent, dry_run=dry_run, stdout=stdout) as manager:
        manager.run(force)
Example #3
0
 def release(cls):
     silent = False
     with CronJobManager(cls, silent) as manager:
         lock = manager.lock_class(cls, manager.silent)
         lock.release()