Before, we were generating previews only for added resources and assuming later that all indexed resources already have at least thumbnails (images don't have previews, only thumbnails).
Now, we check all existing resources for having previews/thumbnails generated.
If there is a thumbnail for a resource already, nothing happens.
If there is no such, new preview and thumbnails generated.
Also, time measurements with writing the results into log added.
Help needed: it is a good idea to handle exceptions coming from preview/thumbnail generation since they are failing whole coroutine and the rest of resources don't get their previews even if we could continue.
See //todo: handle exceptions to not fail the rest of previews generation
Before, we were generating previews only for added resources and assuming later that all indexed resources already have at least thumbnails (images don't have previews, only thumbnails).
Now, we check all existing resources for having previews/thumbnails generated. If there is a thumbnail for a resource already, nothing happens. If there is no such, new preview and thumbnails generated.
Also, time measurements with writing the results into log added.
Help needed: it is a good idea to handle exceptions coming from preview/thumbnail generation since they are failing whole coroutine and the rest of resources don't get their previews even if we could continue. See
//todo: handle exceptions to not fail the rest of previews generation