WordPress Photo Directory provider script does not stop #1372
Labels
💻 aspect: code
Concerns the software code in the repository
🛠 goal: fix
Bug fix
🟧 priority: high
Stalls work on the project or its dependents
🐍 tech: python
Involves Python
Description
After the refactor performed in WordPress/openverse-catalog#835, the WordPress Photo Directory provider script no longer stops attempting to process data after hitting the last page. A recent run with
skip_ingestion_errors
(which was run as a result of #1373) caught the script in an infinite loop which kept it iterating over pages which did not exist. We ended up forcing the run to fail and had a 16MB log file with the following lines repeated thousands of times:The response from that URL is:
It looks like there was some logic for calculating total available pages which were not carried over from the refactor:
https://github.com/WordPress/openverse-catalog/pull/835/files#diff-b98978a812fb92894554fca75f318f598e0135bfda7f2d2c8397f7ae5c5d8fe8L83
Reproduction
{"init_query_params": {'format': 'json', 'page': 49, 'per_page': 100, '_embed': 'true'}}
Additional context
Resolution
The text was updated successfully, but these errors were encountered: