diff --git a/ee/lib/api/admin/search/zoekt.rb b/ee/lib/api/admin/search/zoekt.rb index cfa1b4bcf906e8d0510239c03e9eb2a93743ff0f..f115eafaed56694d2532a96cc5bb0a23bafe1944 100644 --- a/ee/lib/api/admin/search/zoekt.rb +++ b/ee/lib/api/admin/search/zoekt.rb @@ -113,7 +113,7 @@ def ensure_zoekt_indexing_enabled! search = params.fetch(:search, nil) attributes = { root_namespace_id: root_namespace.id } - zoekt_enabled_namespace = ::Search::Zoekt::EnabledNamespace.find_or_create_by(attributes) # rubocop:disable CodeReuse/ActiveRecord -- only be called from this API + zoekt_enabled_namespace = ::Search::Zoekt::EnabledNamespace.create_or_find_by(attributes) # rubocop:disable Performance/ActiveRecordSubtransactionMethods -- only be called from this API if !search.nil? && zoekt_enabled_namespace.search != search zoekt_enabled_namespace.update(search: search) end @@ -123,7 +123,7 @@ def ensure_zoekt_indexing_enabled! zoekt_enabled_namespace_id: zoekt_enabled_namespace.id, namespace_id: zoekt_enabled_namespace.root_namespace_id } - zoekt_index = ::Search::Zoekt::Index.find_or_create_by(attributes) do |record| # rubocop:disable CodeReuse/ActiveRecord -- only be called from this API + zoekt_index = ::Search::Zoekt::Index.create_or_find_by(attributes) do |record| # rubocop:disable Performance/ActiveRecordSubtransactionMethods -- only be called from this API record.state = ::Search::Zoekt::Index.states[:ready] end