Skip to content

Commit

Permalink
Updates config as we had the wrong behaviour around and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mereghost committed Dec 31, 2024
1 parent 8a31412 commit 9a3f62c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@ group :development, :test do
# Output a stack trace anytime, useful when a process is stuck
gem "rbtrace"

# REPL with debug commands
gem "debug"
# REPL with debug commands, Debug changed to byebug due to the issue below
# https://github.com/puma/puma/issues/2835#issuecomment-2302133927
gem "byebug"

gem "pry-byebug", "~> 3.10.0", platforms: [:mri]
gem "pry-doc"
Expand Down
5 changes: 1 addition & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,6 @@ GEM
date_validator (0.12.0)
activemodel (>= 3)
activesupport (>= 3)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
deckar01-task_list (2.3.4)
html-pipeline (~> 2.0)
declarative (0.0.20)
Expand Down Expand Up @@ -1222,6 +1219,7 @@ DEPENDENCIES
brakeman (~> 6.2.0)
browser (~> 6.2.0)
budgets!
byebug
capybara (~> 3.40.0)
capybara-screenshot (~> 1.0.17)
capybara_accessible_selectors!
Expand All @@ -1239,7 +1237,6 @@ DEPENDENCIES
dalli (~> 3.2.0)
dashboards!
date_validator (~> 0.12.0)
debug
deckar01-task_list (~> 2.3.1)
disposable (~> 0.6.2)
doorkeeper (~> 5.8.0)
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class Application < Rails::Application
config.good_job.max_cache = OpenProject::Configuration[:good_job_max_cache]
config.good_job.enable_cron = OpenProject::Configuration[:good_job_enable_cron]
config.good_job.shutdown_timeout = 30
config.good_job.smaller_number_is_higher_priority = false
config.good_job.smaller_number_is_higher_priority = true

config.action_controller.asset_host = OpenProject::Configuration::AssetHost.value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@
expect(good_job_setting.key).to eq("cron_keys_disabled")
expect(good_job_setting.value).to eq(["Storages::ManageStorageIntegrationsJob"])

expect { described_class.disable_cron_job_if_needed }.not_to change(GoodJob::Setting, :count).from(1)
expect { described_class.disable_cron_job_if_needed }.to change(GoodJob::Setting, :count).from(1).to(2)

good_job_setting.reload
expect(good_job_setting.key).to eq("cron_keys_disabled")
expect(good_job_setting.value).to eq([])

good_job_setting = GoodJob::Setting.second
expect(good_job_setting.key).to eq("cron_keys_enabled")
expect(good_job_setting.value).to eq(["Storages::ManageStorageIntegrationsJob"])
end

it "does nothing if the cron_job is not disabled" do
Expand Down

0 comments on commit 9a3f62c

Please sign in to comment.