Added a default value for retries in worker.strategy.#5945
Conversation
I was facing an issue when adding tasks directly to rabbitmq using pika instead of calling task.apply_async. The issue was the self.retry mechanisum was failing. In app/tasks.py the line `retries = request.retries + 1` was causing the issue. On further tracing I figured out that it was because the default .get value (None) was getting passed through this function and was raising TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
auvipy
left a comment
There was a problem hiding this comment.
I would like to see an updated unit test for this
|
I actually wanted to create an issue for the same but the create issue button said that its for maintainers only. Also I have a question, should I change retries value here or update where the retry value is actually getting updated in task.py here or in the update function here. If the current PR is fine, let me know. I'll add the necessary test cases. |
|
generally, we don't merge PR without proper unit tests to avoid regression |
Codecov Report
@@ Coverage Diff @@
## master #5945 +/- ##
=======================================
Coverage 83.21% 83.21%
=======================================
Files 145 145
Lines 17130 17130
Branches 2110 2110
=======================================
Hits 14254 14254
Misses 2661 2661
Partials 215 215
Continue to review full report at Codecov.
|
|
Added test cases for retries as you asked. Let me know if anything else is required. |
|
@auvipy any update on this? |
|
you need to make the Travis green |
I was facing an issue when adding tasks directly to rabbitmq using pika instead of calling
task.apply_async. The issue was the self.retry mechanism was failing. Inapp/tasks.pythe lineretries = request.retries + 1was causing the issue. On further tracing I figured out that it was because the default.getvalue (None) was getting passed through this function and was raisingNote: Before submitting this pull request, please review our contributing
guidelines.
Description