def abort_failed_jobs(self): job_life_span = False if len(self.args) >= 2: job_life_span = unicode_safe(self.args[1]) utils.abort_failed_jobs(job_life_span, include=self.options.include_sources, exclude=self.options.exclude_sources)
def abort_failed_jobs(ctx, life_span, include, exclude): """Abort all jobs which are in a "limbo state" where the job has run with errors but the harvester run command will not mark it as finished, and therefore you cannot run another job. """ flask_app = ctx.meta["flask_app"] with flask_app.test_request_context(): result = utils.abort_failed_jobs(life_span, include, exclude) click.echo(result)