diff --git a/Dockerfile b/Dockerfile index 9deda09..ad74175 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,7 @@ ARG UNAME=app # for rotatelogs RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ - apache2-utils \ - netcat-traditional + apache2-utils # sdrN for volumes and symlinks RUN bash -c 'for i in $(seq 1 24); do ln -s /sdr/$i /sdr$i; done' diff --git a/Gemfile b/Gemfile index 8c0fea7..d7e9ee2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,23 +1,25 @@ source "https://rubygems.org" +gem "base64" +gem "csv" +gem "logger" gem "mysql2" -gem "puma" +gem "net-smtp" +gem "ostruct" gem "pairtree", "~> 0.3" -gem "sidekiq", "~> 6.0" -gem "sequel" +gem "puma" +gem "rake" gem "rubyzip" +gem "sidekiq" +gem "sequel" gem "thor" -gem "rake", "~> 12.3" -gem "csv" -gem "base64" -gem "net-smtp" group :development, :test do - gem "rspec", "~> 3.0" + gem "debug" gem "pry" + gem "rspec" gem "standard" gem "timecop" - gem "byebug" gem "simplecov" gem "simplecov-lcov" end diff --git a/Gemfile.lock b/Gemfile.lock index b12d473..b5ba137 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,118 +3,135 @@ GEM specs: ast (2.4.2) base64 (0.2.0) - bigdecimal (3.1.7) - byebug (11.1.3) + bigdecimal (3.1.8) coderay (1.1.3) connection_pool (2.4.1) csv (3.3.0) + debug (1.9.2) + irb (~> 1.10) + reline (>= 0.3.8) diff-lcs (1.5.1) - docile (1.4.0) - json (2.7.2) + docile (1.4.1) + io-console (0.7.2) + irb (1.14.1) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.7.6) language_server-protocol (3.17.0.3) lint_roller (1.1.0) + logger (1.6.1) method_source (1.1.0) mysql2 (0.5.6) net-protocol (0.2.2) timeout net-smtp (0.5.0) net-protocol - nio4r (2.7.1) + nio4r (2.7.4) + ostruct (0.6.0) pairtree (0.3.0) - parallel (1.24.0) - parser (3.3.0.5) + parallel (1.26.3) + parser (3.3.5.1) ast (~> 2.4.1) racc pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - puma (6.4.2) + psych (5.1.2) + stringio + puma (6.4.3) nio4r (~> 2.0) - racc (1.7.3) - rack (2.2.9) + racc (1.8.1) + rack (3.1.8) rainbow (3.1.1) - rake (12.3.3) - redis (4.8.1) - regexp_parser (2.9.0) - rexml (3.2.6) + rake (13.2.1) + rdoc (6.7.0) + psych (>= 4.0.0) + redis-client (0.22.2) + connection_pool + regexp_parser (2.9.2) + reline (0.5.10) + io-console (~> 0.5) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.0) + rspec-core (3.13.2) rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) - rubocop (1.62.1) + rubocop (1.66.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.4, < 3.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) - rubocop-performance (1.20.2) + rubocop-ast (1.33.1) + parser (>= 3.3.1.0) + rubocop-performance (1.22.1) rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) rubyzip (2.3.2) - sequel (5.79.0) + sequel (5.86.0) bigdecimal - sidekiq (6.5.12) - connection_pool (>= 2.2.5, < 3) - rack (~> 2.0) - redis (>= 4.5.0, < 5) + sidekiq (7.3.4) + connection_pool (>= 2.3.0) + logger + rack (>= 2.2.4) + redis-client (>= 0.22.2) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-html (0.12.3) + simplecov-html (0.13.1) simplecov-lcov (0.8.0) simplecov_json_formatter (0.1.4) - standard (1.35.1) + standard (1.41.1) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.62.0) + rubocop (~> 1.66.0) standard-custom (~> 1.0.0) - standard-performance (~> 1.3) + standard-performance (~> 1.5) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.3.1) + standard-performance (1.5.0) lint_roller (~> 1.1) - rubocop-performance (~> 1.20.2) - thor (1.3.1) - timecop (0.9.8) + rubocop-performance (~> 1.22.0) + stringio (3.1.1) + thor (1.3.2) + timecop (0.9.10) timeout (0.4.1) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) PLATFORMS ruby DEPENDENCIES base64 - byebug csv + debug + logger mysql2 net-smtp + ostruct pairtree (~> 0.3) pry puma - rake (~> 12.3) - rspec (~> 3.0) + rake + rspec rubyzip sequel - sidekiq (~> 6.0) + sidekiq simplecov simplecov-lcov standard @@ -122,4 +139,4 @@ DEPENDENCIES timecop BUNDLED WITH - 2.5.9 + 2.5.16 diff --git a/lib/datasets/sidekiq_jobs.rb b/lib/datasets/sidekiq_jobs.rb index c4d8a1d..00d6e6d 100644 --- a/lib/datasets/sidekiq_jobs.rb +++ b/lib/datasets/sidekiq_jobs.rb @@ -14,9 +14,10 @@ def setup_logs rotatelogs_cmd = "/usr/bin/rotatelogs -f -l #{log_template} 86400" log_io = IO.popen(rotatelogs_cmd, "w") log_io.sync = true - - Sidekiq.logger = Logger.new(log_io) - Sidekiq.logger.level = Logger::INFO + Sidekiq.configure_server do |config| + config.logger = Logger.new(log_io) + config.logger.level = Logger::INFO + end end load_config diff --git a/spec/support/contexts/with_mocked_sidekiq_logger.rb b/spec/support/contexts/with_mocked_sidekiq_logger.rb index f669f11..11ed8e2 100644 --- a/spec/support/contexts/with_mocked_sidekiq_logger.rb +++ b/spec/support/contexts/with_mocked_sidekiq_logger.rb @@ -1,12 +1,16 @@ RSpec.shared_context "with mocked sidekiq logger" do before(:each) do @orig_logger = Sidekiq.logger - Sidekiq.logger = double(:logger, - info: nil, - debug: nil) + Sidekiq.configure_embed do |config| + config.logger = double(:logger, + info: nil, + debug: nil) + end end after(:each) do - Sidekiq.logger = @orig_logger + Sidekiq.configure_embed do |config| + config.logger = @orig_logger + end end end