Skip to content

Commit

Permalink
refactor: 显性设置异步任务是 sidekiq
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Jul 24, 2020
1 parent 03df231 commit 491103a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
21 changes: 9 additions & 12 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0

# config.autoloader = :classic

# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading

# Set default timezone
config.time_zone = ENV['TIME_ZONE'] || 'Beijing'
config.active_record.default_timezone = :local
Expand Down Expand Up @@ -80,16 +74,19 @@ class Application < Rails::Application
# config.assets.enabled = false
# config.assets.compile = false

# Use a real queuing backend for Active Job (and separate queues per environment)
config.active_job.queue_adapter = :sidekiq

################################################################

# Auto load path
config.autoload_paths += %W(
#{config.root}/lib
)
config.autoload_paths += [
Rails.root.join('lib')
]

config.eager_load_paths += %W(
#{config.root}/lib
)
# config.eager_load_paths += %W(
# #{config.root}/lib
# )

# Don't generate system test files.
config.generators.system_tests = nil
Expand Down
2 changes: 2 additions & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Load the Rails application.
require_relative 'application'

Expand Down
5 changes: 2 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@
# Prepend all log lines with the following tags.
config.log_tags = [:request_id]

# Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "zealot_#{Rails.env}"
config.action_mailer.perform_caching = false

# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
config.action_mailer.raise_delivery_errors = false
# config.action_mailer.default_url_options = { host: Setting.site_domain }


# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
Expand Down
2 changes: 2 additions & 0 deletions config/spring.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

Spring.watch(
'.ruby-version',
'.rbenv-vars',
Expand Down

0 comments on commit 491103a

Please sign in to comment.