Commit 4ea9f1bb authored by Dmitry Gruzd's avatar Dmitry Gruzd

Merge branch '323856-increase-timeout-on-indexing-elasticsearch-project-lock' into 'master'

Update lock timeout in ElasticCommitIndexerWorker to 1 day

See merge request gitlab-org/gitlab!60768
parents a900240e 88d56756
......@@ -25,7 +25,7 @@ class ElasticCommitIndexerWorker
project = Project.find(project_id)
return true unless project.use_elasticsearch?
in_lock("#{self.class.name}/#{project_id}/#{wiki}", ttl: 1.hour, retries: 0) do
in_lock("#{self.class.name}/#{project_id}/#{wiki}", ttl: 1.day, retries: 0) do
Gitlab::Elastic::Indexer.new(project, wiki: wiki).run
end
end
......
---
title: Update lock timeout in ElasticCommitIndexerWorker
merge_request: 60768
author:
type: fixed
......@@ -37,7 +37,7 @@ RSpec.describe ElasticCommitIndexerWorker do
it 'does not run index when it is locked' do
expect(subject).to receive(:in_lock) # Mock and don't yield
.with("ElasticCommitIndexerWorker/#{project.id}/false", ttl: 1.hour, retries: 0)
.with("ElasticCommitIndexerWorker/#{project.id}/false", ttl: 1.day, retries: 0)
expect(Gitlab::Elastic::Indexer).not_to receive(:new)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment