I need a nodejs script that when i run will check a specific s3 location for images that have been run since the last time it was run and will optimize them. We will optimize by using [login to view URL] this kraken integration. We will fetch and optimize and put back the new image. Kraken can actually write the image back for us. We will write the image back with the same extension and name as the original.
We wont maintain a database for this instead we will keep a txt file in the root of the bucket that has the last moment we optimized a file. this will serve as the start date for the next time this script runs.
The nodejs code will need to run in [login to view URL] as a worker. we will schedule this worker at some interval that makes sense for us using the [login to view URL] UI.
I need 2 workers. 1 lossless and 1 lossy. all functions will be the same otherwise.