Good question – this is called in two places. PostCreator:
And PostRevisor:
However as you can see I neglected to do the SiteSetting.secure_uploads? check in the latter…I will make a PR to fix this and just move the check to post.update_uploads_secure_status.
Edit: PR is here, hopefully should merge today FIX: Do not enqueue UpdatePostUploadsSecureStatus unnecessarily by martin-brennan · Pull Request #20366 · discourse/discourse · GitHub