diff --git a/CHANGELOG b/CHANGELOG index 20b6dce1764cd461f6ac46d1ff87c74de5a92f28..256e445d7df4c7b136ae08123cd59778621ac572 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.1.0 (unreleased) + - Fix bug where projects would appear to be stuck in the forked import state (Stan Hu) - Show CI status on all pages where commits list is rendered - Automatically enable CI when push .gitlab-ci.yml file to repository - Move CI charts to project graphs area diff --git a/app/models/project.rb b/app/models/project.rb index a7ea1236b8686d76bbdfad545c0762eaf136ee2b..5deddb2fbc41e3709c84ee1adf97ba32b83bb984 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -276,8 +276,10 @@ class Project < ActiveRecord::Base end def add_import_job + # Schedule these jobs after 2 seconds to ensure DB changes to import_status + # are saved by the time the workers start if forked? - unless RepositoryForkWorker.perform_async(id, forked_from_project.path_with_namespace, self.namespace.path) + unless RepositoryForkWorker.perform_in(2.seconds, id, forked_from_project.path_with_namespace, self.namespace.path) import_fail end else