-
Notifications
You must be signed in to change notification settings - Fork 21
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
Product Statuses - Handle failure of the Update Product Statuses Job #2271
Product Statuses - Handle failure of the Update Product Statuses Job #2271
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## fix/issue-with-intermediate-parents-status #2271 +/- ##
============================================================================
Coverage 60.0% 60.0%
- Complexity 4181 4184 +3
============================================================================
Files 457 457
Lines 17721 17748 +27
============================================================================
+ Hits 10627 10647 +20
- Misses 7094 7101 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Thanks for handling failures of update product statuses job. I can see the error in the response data when calling wc/gla/mc/product-statistics
endpoint. LGTM.
Thanks @ianlin for your time reviewing this PR! |
Changes proposed in this Pull Request:
Follow-up of #2257.
Part of #2146 & #2250
Since we're calculating product statuses using AS jobs, there's a possibility that the job might fail when attempting to retrieve or update the data. Therefore, it's important to store this error so we can notify the client about any issues while updating the product statuses.
Action Scheduler will retry the job, and if it succeeds, the process will continue as usual and the error message will be overridden once all statuses are completed.
However, if the job fails permanently and the failure rate exceeds the threshold, AS will stop the job. In this case, when the client requests the data via
GET wc/gla/mc/product-statistics
, the response will contain the error message.Detailed test instructions:
throw new \Error('My fatal error');
ingoogle-listings-and-ads/src/API/Google/MerchantReport.php
Line 67 in b544a50
GET wc/gla/mc/product-statistics/refresh
gla/jobs/update_merchant_product_statuses/process_item
and see that the jobs fails.wc/gla/mc/product-statistics
and see that the error is present in the transient.Additional details:
Changelog entry