OK, I tried this for 4 hours and am stuck. I need some bubbly help:
- I like to run a backend workflow to cleanup my data. This shall run every night.
- The process shall compare two things: I have a data table that registers all uploaded images by the users (asimple list with only the image path). Also, I have a data table with application data by the users, here I also record the 3 images they shall upload.
- In case a user uploded many images but did not submit his application, I have now these images as “trash” in my system. I can find them by comparing if the images in the “userUpload” table is also in the “application” table - if not, it is an unused image and can be deleted.
I have real troubles setting this logic up. I came to this setup finally, but it is far from optimized:
- I run 2 workflows. The first one is running another API workflow for a list of things (all userUpload images) and hands over this userUpload image to the second workflow. The second workflow is taking this as parameter and searches in all data by the application table for this image path. If it does not find it, it deletes the file.
However: This creates a really heavy MU workload, as I do a full search request on every image. I wonder if there is any best practise or better way to clean up images in a smarter and lighter way?