When there are many tags in a container repository, deleting them
can exceed the default 60 second idle-in-transaction timeout in
Sidekiq. We now explicitly delete them in the DestroyService
before destroying the model.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51380
When a container registry has many tags, it's easy for the DELETE call to take more
than 60 seconds and fail. This can also leave the registry in a bad state with
null bytes since some of the images have been deleted with tags still pointing to them.
In addition, we have to prevent users from accidentally initiating the delete multiple
times or this could leave the registry with orphaned tags.
This commit also adds a flash message to notify the user the registry is scheduled
for deletion.
Closes#49926, #51063