Avoid destroy an image repository if a migration is running
🔥 Problem
Users can destroy image repositories when we are migrating them.
Image repository destruction are delegated to a background job.
If a repository is deleted during its migration, it can lead to inconsistent states.
🚒 Solution
When the worker starts its execution, check the migration state.
If it's pre importing, pre import done or importing, the execute should re enqueue the job in the future. Use the dynamic pre-import timeout and a fixed part for the import part.
Edited by David Fernandez