humanmade / aws-rekognition

A lightweight plugin to add keywords to WordPress image uploads via automatic feature detection. Requires S3 Uploads.
57 stars 6 forks source link

Hotfix: Remove Labels polling from Attachment Details view #30

Closed joehoyle closed 6 months ago

joehoyle commented 6 months ago

This is implented a bit too naively, which means a very large amount of admin-ajax requests can be sent when images don't have labels (perhaps imported images, or just uploaded images). If images are uploaded, or when an attachment detail is opened for any image without labels, it's going to queue a .fetch() every time heartbeat happens.

There would need to be some stop clause for this to be implemented in the future. I.e. once the labels are populated then polling stops, and / or polling only happens as long as the media details are open. Either way, that's more of a complex solution, and in the short term it's best to disable the auto-polling.