Commit ea4858cc authored by Gabriel Mazetto's avatar Gabriel Mazetto Committed by Robert Speicher

Codestyle and changelog changes

parent 5ec85f24
module Geo
class RepositoryUpdateService
attr_reader :project, :clone_url
attr_reader :project, :clone_url, :logger
LEASE_TIMEOUT = 1.hour.freeze
LEASE_KEY_PREFIX = 'geo_repository_fetch'.freeze
def initialize(project, clone_url, logger = nil)
def initialize(project, clone_url, logger = Rails.logger)
@project = project
@clone_url = clone_url
@logger = logger
......@@ -39,10 +39,8 @@ module Geo
begin
yield
ensure
if repository_lease.present?
log('Releasing leases to sync repository')
Gitlab::ExclusiveLease.cancel(lease_key, repository_lease)
end
log('Releasing leases to sync repository')
Gitlab::ExclusiveLease.cancel(lease_key, repository_lease)
end
end
......@@ -53,9 +51,5 @@ module Geo
def log(message)
logger.info("#{self.class.name}: #{message} for project #{project.path_with_namespace} (#{project.id})")
end
def logger
@logger || Rails.logger
end
end
end
---
title: Improve Repository Sync (with new SystemHook)
title: Geo: Improve Repository Sync (with new SystemHook)
merge_request: 1789
author:
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