Service(s) need to be created that allow an image listed in the mediamoderation_scan table or present in the uploadstash table to be scanned using the PhotoDNA API. These services should meet the following requirements:
- Failures or rate-limit exceeds should be properly handled, such that the file is still marked as unscanned
- If the thumbnail for an image is not available and cannot be generated on-demand, the image should be skipped and still marked as unscanned
- When a scan occurs, a statsd event should be created with relevant description about which code triggered the scan.
- The service(s) should return the scan result to the caller or should update the mediamoderation_scan row.
A service currently exists in the extension to do this in the extension, but will be re-written to support the needs of T351399: Create a maintenance script to automatically scan files listed in mediamoderation_scan and T351396: Create a maintenance script to check the uploadstash table.
Acceptance criteria
- These services should meet the requirements detailed above
- These services should be fully tested