Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scheduler pre_send exception handling #254

Merged

Conversation

stinovlas
Copy link
Contributor

Followup to #244.

This PR implements a new exception ScheduledTaskCancelledError which can be raised in ScheduleSource.pre_send method.

This exception is then caught and processed in TaskiqScheduler.on_ready. This way, schedule source can decide upon invocation whether the task should be actually performed or not.

@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (708d60c) 77.10% compared to head (8497307) 77.20%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #254      +/-   ##
===========================================
+ Coverage    77.10%   77.20%   +0.09%     
===========================================
  Files           60       60              
  Lines         1743     1750       +7     
===========================================
+ Hits          1344     1351       +7     
  Misses         399      399              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@s3rius
Copy link
Member

s3rius commented Dec 5, 2023

Looks good to me.

@s3rius s3rius merged commit eaf704e into taskiq-python:develop Dec 5, 2023
23 checks passed
@s3rius
Copy link
Member

s3rius commented Dec 5, 2023

Thanks for your contribution.

@stinovlas stinovlas deleted the add-scheduler-pre-send-error branch December 5, 2023 10:36
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.

3 participants