David Kimura PRO said almost 4 years ago on Direct Upload Instantly :
Thanks   . I'm still researching how I would handle it as the current solutions that I've come up with aren't up to my satisfaction yet. I have some ideas, but not fully ready to share. The ideas that I'm bouncing around is a background job which periodically handles the orphan records. However, this imposes additional infrastructure which may not already be in place. It could also be expensive in cases where Active Storage is heavily used. I think that a better route would be to have a background job which is triggered to be performed at a later time which can then check later if the record is orphaned or not. However, this also has its own drawbacks because there could be a case where a small queue server could get overwhelmed with requests and essentially lost jobs.