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

  1. Export a GitLab Pages project
  2. Try importing it
  3. See the above error in the logs
Edited Oct 04, 2017 by Adam Mulvany
Assignee Loading
Time tracking Loading