dbader / dbader/schedule

Cancel job after X failures

Open
#288 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
12.3k
Forks
999
PR merge metrics
No merged PRs in 30d

Description

My scheduled jobs try to retrieve files from a remote server. It may happen that the request times out or just fails for another reason. This failure can be temporary e.g. the server is offline, but will be back online soon. Now I want to know when an exception occurs, which is what I use [`cancel_on_failure`](https://schedule.readthedocs.io/en/stable/faq.html#what-if-my-task-throws-an-exception) for. If the exception keeps occurring and is not only temporary I want the job to be cancelled.

What I'm looking for is like `cancel_after_retries=10` or a possibility to combine `cancel_on_failure` with [tenacity's](https://github.com/jd/tenacity) retry behavior

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing cancel_on_failure behavior in the linked FAQ and reviewing how tenacity represents retry failures. Define how repeated exceptions are counted and when the scheduled job is cancelled; done should provide a documented, usable way to cancel after a configured number of failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.