From ba174c982f40d71a87fd511b091753807174f7e7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 6 Apr 2020 12:10:44 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/models/project_import_state.rb | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'app/models/project_import_state.rb') diff --git a/app/models/project_import_state.rb b/app/models/project_import_state.rb index cdb034e58fa..52fd23aefd5 100644 --- a/app/models/project_import_state.rb +++ b/app/models/project_import_state.rb @@ -2,6 +2,7 @@ class ProjectImportState < ApplicationRecord include AfterCommitQueue + include ImportState::SidekiqJobTracker self.table_name = "project_mirror_data" @@ -88,20 +89,6 @@ class ProjectImportState < ApplicationRecord # import? does SQL work so only run it if it looks like there's an import running status == 'started' && project.import? end - - # Refreshes the expiration time of the associated import job ID. - # - # This method can be used by asynchronous importers to refresh the status, - # preventing the StuckImportJobsWorker from marking the import as failed. - def refresh_jid_expiration - return unless jid - - Gitlab::SidekiqStatus.set(jid, StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION) - end - - def self.jid_by(project_id:, status:) - select(:jid).with_status(status).find_by(project_id: project_id) - end end ProjectImportState.prepend_if_ee('EE::ProjectImportState') -- cgit v1.2.1