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
Make FileFetcher a separate queue item #4004
Conversation
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.
Another issue that is I think an actual bug - if the localize_import job encounters a 404, it throws an exception and re-queues. So if there is a typo in one of your URLs, it will be re-queued forever (or at least until you delete the queue manually). Suggest that this also work more like the import job, where exceptions from curl are caught the way mysql errors are, stored in the error field in the jobstore result so that they can be seen in the dashboard, and then the item is considered done with statuis "error".
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.
Need to add docs on dkan:datastore:localize
RE: 404 leading to an endless loop of queued localizations: Added a case where if This also changes the way logging happens, so it improves the output when you localize through Drush. This is tested in |
Updated the docs. |
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.
Overall love these changes and tested with PDC successfully.
I also copied the PDC DB from production and ran some harvests to see what would happen and I did run into some errors because it looked like localizer was still looking for the files on the production server versus in the local environment.
ResourceLocalizer
so it can perform its function or defer to a queue item.LocalizeQueueWorker
, which can perform localization for a dataset within the queue.drush dkan:datastore:localize
which is analogous todkan:datastore:import
. It can queue items or perform the localization directly.ResourceLocalizer
now sends an event when localization is complete:ResourceLocalizer::EVENT_RESOURCE_LOCALIZED
DatastoreSubscriber
subscribes to this new event and creates corresponding datastore import queue items in response.localize_import
queue in addition to thedatastore_import
queue.QA:
/admin/dkan/datastore/status
You should see that the dataset is not fetched and not stored.drush queue:list
localize_import
queue.drush queue:run localize_import
drush queue:list
should show you one queue item fordatastore_import
.datastore_import
queue, either with cron ordrush queue:run
.