Skip to content

Commit

Permalink
Fix some start up issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Dec 19, 2023
1 parent c042fc9 commit d2ba158
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/models/concerns/global_setting_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def has_setting(setting, type: :string, default: nil)
end

if type == :boolean
alias_method "#{setting}?", setting
singleton_class.send(:alias_method, "#{setting}?", setting)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Setting < ApplicationRecord
validates :transcode_bitrate, inclusion: {in: AVAILABLE_BITRATE_OPTIONS}, allow_nil: true
validate :media_path_exist

after_update :sync_media, if: :saved_change_to_media_path?
after_update :toggle_media_listener, if: :saved_change_to_enable_media_listener?
after_update_commit :sync_media, if: :saved_change_to_media_path?

private

Expand Down
7 changes: 1 addition & 6 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.
#
# preload_app!
preload_app!

# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart
Expand All @@ -55,10 +54,6 @@
end

if BlackCandy::Config.embedded_sidekiq?
# Preloading the application is necessary to ensure
# the configuration in your initializer runs before
# the boot callback below.
preload_app!
sidekiq = nil

on_worker_boot do
Expand Down

0 comments on commit d2ba158

Please sign in to comment.