diff options
Diffstat (limited to 'lib/gitlab/database/async_indexes')
-rw-r--r-- | lib/gitlab/database/async_indexes/index_creator.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/database/async_indexes/index_destructor.rb | 6 |
2 files changed, 3 insertions, 11 deletions
diff --git a/lib/gitlab/database/async_indexes/index_creator.rb b/lib/gitlab/database/async_indexes/index_creator.rb index 2fb4cc8f675..3ae2bb7b3e5 100644 --- a/lib/gitlab/database/async_indexes/index_creator.rb +++ b/lib/gitlab/database/async_indexes/index_creator.rb @@ -4,10 +4,10 @@ module Gitlab module Database module AsyncIndexes class IndexCreator - include ExclusiveLeaseGuard + include IndexingExclusiveLeaseGuard TIMEOUT_PER_ACTION = 1.day - STATEMENT_TIMEOUT = 9.hours + STATEMENT_TIMEOUT = 20.hours def initialize(async_index) @async_index = async_index @@ -47,10 +47,6 @@ module Gitlab TIMEOUT_PER_ACTION end - def lease_key - [super, async_index.connection_db_config.name].join('/') - end - def set_statement_timeout connection.execute("SET statement_timeout TO '%ds'" % STATEMENT_TIMEOUT) yield diff --git a/lib/gitlab/database/async_indexes/index_destructor.rb b/lib/gitlab/database/async_indexes/index_destructor.rb index fe05872b87a..66955df9d04 100644 --- a/lib/gitlab/database/async_indexes/index_destructor.rb +++ b/lib/gitlab/database/async_indexes/index_destructor.rb @@ -4,7 +4,7 @@ module Gitlab module Database module AsyncIndexes class IndexDestructor - include ExclusiveLeaseGuard + include IndexingExclusiveLeaseGuard TIMEOUT_PER_ACTION = 1.day @@ -53,10 +53,6 @@ module Gitlab TIMEOUT_PER_ACTION end - def lease_key - [super, async_index.connection_db_config.name].join('/') - end - def log_index_info(message) Gitlab::AppLogger.info(message: message, table_name: async_index.table_name, index_name: async_index.name) end |