diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-06 12:10:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-06 12:10:44 +0000 |
commit | ba174c982f40d71a87fd511b091753807174f7e7 (patch) | |
tree | b89d55c715288f2c2f76724c1b7ff4a6ebf90154 /app/models/project_import_state.rb | |
parent | eaea945e0355826c58c3dcf887496ea91064f85c (diff) | |
download | gitlab-ce-ba174c982f40d71a87fd511b091753807174f7e7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project_import_state.rb')
-rw-r--r-- | app/models/project_import_state.rb | 15 |
1 files changed, 1 insertions, 14 deletions
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') |