Skip to content

Add in_ and at helpers to allow for directly requesting a retry#130

Merged
bunchesofdonald merged 1 commit intochrisguidry:mainfrom
bunchesofdonald:requested-retries
May 19, 2025
Merged

Add in_ and at helpers to allow for directly requesting a retry#130
bunchesofdonald merged 1 commit intochrisguidry:mainfrom
bunchesofdonald:requested-retries

Conversation

@bunchesofdonald
Copy link
Collaborator

Closes #129

Copy link
Owner

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API looks great, and it's super cool we could implement this without changing worker. It does mean that what shows up in the logs is a task failure, which I'm good with right now. We may find that we want these to be treated as "normal" flow-control exceptions and not log them as failures, but this is a great first step.

Another thing I was thinking about: what happens if someone calls ExponentialRetry.in_(...)? Maybe ExponentialRetry shouldn't have a minimum_delay attribute, but re-use the delay attribute from the base Retry?

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (0244315) to head (f0d1a6f).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #130   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         3223      3293   +70     
  Branches       183       186    +3     
=========================================
+ Hits          3223      3293   +70     
Flag Coverage Δ
python-3.12 100.00% <100.00%> (ø)
python-3.13 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/docket/dependencies.py 100.00% <100.00%> (ø)
tests/test_dependencies.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bunchesofdonald bunchesofdonald merged commit ca58e02 into chrisguidry:main May 19, 2025
12 of 14 checks passed
@bunchesofdonald
Copy link
Collaborator Author

I believe the docs failure here is because this came in from a fork, rather than being part of this repo directly.

@bunchesofdonald bunchesofdonald deleted the requested-retries branch May 19, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow a task to request a retry

3 participants