Importing a GitLab Pages project results in `PagesWorker.perform_async` cannot be called inside a transaction
Summary
While importing a GitLab Pages project, user gets the following error:
Error importing repository into namespace/asdfasdf - `PagesWorker.perform_async` cannot be called inside a transaction as this can lead to
race conditions when the worker runs before the transaction is committed and
tries to access a model that has not been saved yet.
Use an `after_commit` hook, or include `AfterCommitQueue` and use a `run_after_commit` block instead.
Steps to reproduce
- Export a GitLab Pages project
- Try importing it
- See the above error in the logs
Edited by Adam Mulvany