diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 21:10:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 21:10:32 +0300 |
commit | 21db5294d4ba402f9d44a1f59e8344daef0911a2 (patch) | |
tree | d888dbe0a42ce86efe9e235602fe5209b196ada7 /lib/gitlab/github_import/issuable_finder.rb | |
parent | 155f106fd5b5214c387e9b9143e9fa5725daed54 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/github_import/issuable_finder.rb')
-rw-r--r-- | lib/gitlab/github_import/issuable_finder.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/github_import/issuable_finder.rb b/lib/gitlab/github_import/issuable_finder.rb index 136531505ea..5298a3d81ea 100644 --- a/lib/gitlab/github_import/issuable_finder.rb +++ b/lib/gitlab/github_import/issuable_finder.rb @@ -23,7 +23,7 @@ module Gitlab # # This method will return `nil` if no ID could be found. def database_id - val = Gitlab::Cache::Import::Caching.read(cache_key) + val = Gitlab::Cache::Import::Caching.read(cache_key, timeout: timeout) val.to_i if val.present? end @@ -32,7 +32,7 @@ module Gitlab # # database_id - The ID of the corresponding database row. def cache_database_id(database_id) - Gitlab::Cache::Import::Caching.write(cache_key, database_id) + Gitlab::Cache::Import::Caching.write(cache_key, database_id, timeout: timeout) end private @@ -76,6 +76,14 @@ module Gitlab ) end end + + def timeout + if project.group.present? && ::Feature.enabled?(:github_importer_single_endpoint_notes_import, project.group, type: :ops, default_enabled: :yaml) + Gitlab::Cache::Import::Caching::LONGER_TIMEOUT + else + Gitlab::Cache::Import::Caching::TIMEOUT + end + end end end end |