-
Notifications
You must be signed in to change notification settings - Fork 1
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
(#64) Support tasks retry & propagate raised exception #65
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
==========================================
+ Coverage 99.21% 99.59% +0.38%
==========================================
Files 18 21 +3
Lines 635 988 +353
==========================================
+ Hits 630 984 +354
+ Misses 5 4 -1 ☔ View full report in Codecov by Sentry. |
aaeb820
to
bff64dc
Compare
8a2e01a
to
4d4c0c0
Compare
cglotr
requested changes
Dec 3, 2023
cglotr
approved these changes
Aug 4, 2024
146f8f6
to
3f815a1
Compare
For documentation, see: 1. Docstring of `task.task` 2. Tests in `tests.test_task` e.g. `test_retry_as_per_task_definition` 3. Sample usages in `tests.apps.simple_app` e.g. `append_to_file` Changelist: * Formalize serialization and deserialization * Serialize & deserialize exceptions correctly * Encapsulate retry & retry_on in a new dict 'options' * Implement serde for AsyncResult * Ensure generated file deleted after test * Add jsonpickle to toml file * Exclude `if TYPE_CHECKING:` from coverage * Add test for singleton * Add logging for worker * Wrap all constants inside `Config` class * Handle case when `options.retry.on` is empty Signed-off-by: Imran Ariffin <ariffin.imran@gmail.com> Requested changes: * Rename constants.py to config.py * Split file into config.py & constants.py * Avoid retrying forever * Move logic from `AsyncResult.from_publisher` to `Task._get_result`. This way `AsyncResult` can be just a pure class with no side-effect Fixups: * Fix docker-compose cmd not found on GithubAction
3f815a1
to
ed6c94f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(#64) Support tasks retry & propagate raised exception
For documentation, see:
task.task
(which will point tointerfaces.TaskOptions
and in turninterfaces.RetryOptions
)tests.test_task
e.g.test_retry_as_per_task_definition
tests.apps.simple_app
e.g.append_to_file
Changelist:
if TYPE_CHECKING:
from coverageConfig
classconstants.py
intoconstants.py
andconfig.py
(cc @cglotr)AsyncResult
to be a simple class with no async-await, and remove unused attributes (cc @cglotr)options.retry.on
is empty