A maintenance script is needed that automatically scans images listed in the mediamoderation_scan table. This script should meet several requirements:
- It should be able to choose what files to process and/or prioritise based on the last time the file was scanned
- It should be reliable in getting an appropriately sized thumbnail of the file being scanned
- Any file that does not have a thumbnail and cannot be generated on-demand should be left for a future scan run
- Any errors or warnings in the maintenance script are properly logged
- An event be emitted to statsd when a check is performed for monitoring the number of requests to the API per wiki
- This script should email to a specified email address if a file is determined to be a match (T351407)
This will replace the existing maintenance script so that it can be easily run automatically.
Acceptance criteria
- Ensure the requirements for the maintenance script are met (except the last which will be done in a different task)
- Ensure the maintenance script is well tested