Commit 09009f0a authored by Robert Speicher's avatar Robert Speicher

Merge branch 'tc-move-geo-cursor-bin' into 'master'

Move geo_log_cursor binary to the ee folder

Closes #10806

See merge request gitlab-org/gitlab-ee!10821
parents 7289e143 77e0ff4c
......@@ -77,6 +77,7 @@ Naming/FileName:
- 'qa/spec/**/*'
- 'qa/qa/specs/**/*'
- 'qa/bin/*'
- 'ee/bin/*'
- 'config/**/*'
- 'ee/config/**/*'
- 'lib/generators/**/*'
......
#!/usr/bin/env ruby
# vim: ft=ruby
# frozen_string_literal: true
require 'rubygems'
require 'bundler/setup'
require 'optparse'
def rails_path(relname)
Pathname.new(__FILE__).dirname.join('../..').join(relname).realpath
end
class GeoLogCursorOptionParser
def self.parse(argv)
options = {}
......@@ -22,7 +27,7 @@ class GeoLogCursorOptionParser
end
op.on('-v', '--version') do
# Load only necessary libraries for faster startup
require "#{File.dirname(__FILE__)}/../lib/gitlab/geo/log_cursor/daemon"
require rails_path('ee/lib/gitlab/geo/log_cursor/daemon.rb')
puts Gitlab::Geo::LogCursor::Daemon::VERSION
exit
......@@ -39,7 +44,7 @@ if $0 == __FILE__
options = GeoLogCursorOptionParser.parse(ARGV)
# We load rails environment / initializers only here to get faster command line startup when `--help` and `--version`
require "#{File.dirname(__FILE__)}/../config/environment"
require rails_path('config/environment.rb')
Gitlab::Geo::LogCursor::Daemon.new(options).run!
end
---
title: Move geo_log_cursor binary to the ee folder
merge_request: 10821
author:
type: other
......@@ -4,11 +4,9 @@ module Gitlab
module Geo
module LogCursor
class Daemon
include Utils::StrongMemoize
VERSION = '0.2.0'.freeze
BATCH_SIZE = 250
SECONDARY_CHECK_INTERVAL = 1.minute
SECONDARY_CHECK_INTERVAL = 60
attr_reader :options
......@@ -130,9 +128,7 @@ module Gitlab
end
def logger
strong_memoize(:logger) do
Gitlab::Geo::LogCursor::Logger.new(self.class, log_level)
end
@logger ||= Gitlab::Geo::LogCursor::Logger.new(self.class, log_level)
end
def log_level
......
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