-
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
Fix: Error is raised when retrying failed tasks for OPENSPP #92
Fix: Error is raised when retrying failed tasks for OPENSPP #92
Conversation
Signed-off-by: Rommel Terrence Juanillo <terrence@newlogic.com>
f183055
to
8b0dd82
Compare
card_generator/tasks/cards.py
Outdated
@@ -12,6 +13,38 @@ | |||
logger = logging.getLogger(__name__) | |||
|
|||
|
|||
class OPENSPPCeleryTask(Task): | |||
max_retries = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@renceInbox this variable seems to be unused. If it is not unused, this setting should be provided through an environment variable.
card_generator/tasks/cards.py
Outdated
@@ -109,14 +142,14 @@ def merge_cards(self, batch_id: int) -> None: | |||
) | |||
except Exception as e: # noqa Lets catch all errors error for debugging and retry | |||
logger.info(f"Error raised on client. {str(e)}") | |||
self.retry(exc=e, countdown=30) | |||
return | |||
raise self.retry(exc=e, countdown=30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@renceInbox please make the retry interval (countdown
) a setting provided through an environment variable.
card_generator/tasks/cards.py
Outdated
client.update_queue_batch_record(batch_id=batch_id, data=data) | ||
self.retry(exc=e, countdown=30) | ||
return | ||
raise self.retry(countdown=30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@renceInbox same comment as above – the should be an env setting.
46da0e4
into
fix/specify-ssl-context-for-xmlrpc
self.retry(exc=e, countdown=30)
restart: Always
on prod config for celeryerror_merging
when the task failed instead on the first retry.