Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,12 @@ class Application < Rails::Application
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")

# Use GoodJob for Active Job queue adapter
config.active_job.queue_adapter = :good_job

# Only loads a smaller set of middleware suitable for API only apps.
# Middleware like session, flash, cookies can be added back manually.
# Skip views, helpers and assets when generating a new resource.
config.api_only = false

config.good_job.cron = {
feed_refresh: { # each recurring job must have a unique key
cron: "every 3 hours", # cron-style scheduling format by fugit gem
class: "FeedRefresherJob", # name of the job class as a String; must reference an Active Job job class
description: "Refreshed feeds and creates new entries", # optional description that appears in Dashboard,
enabled_by_default: -> { Rails.env.production? } # Only enable in production, otherwise can be enabled manually through Dashboard
}
}
end
end
3 changes: 0 additions & 3 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
# Highlight code that enqueued background job in logs.
config.active_job.verbose_enqueue_logs = true

# Use GoodJob for Active Job queue adapter
config.active_job.queue_adapter = :good_job

# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true

Expand Down
5 changes: 0 additions & 5 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
# Replace the default in-process memory cache store with a durable alternative.
# config.cache_store = :mem_cache_store

# Replace the default in-process and non-durable queuing backend for Active Job.
config.active_job.queue_adapter = :good_job

config.good_job.cron_graceful_restart_period = 1.minute

# 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
Expand Down
13 changes: 12 additions & 1 deletion config/initializers/good_job.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# GoodJob configuration
Rails.application.configure do
# Configure GoodJob settings
config.good_job.execution_mode = :external
# config.good_job.execution_mode = :external
config.good_job.max_threads = 5
config.good_job.poll_interval = 30
config.good_job.shutdown_timeout = 25

# Enable cron jobs
config.good_job.enable_cron = true
config.good_job.cron_graceful_restart_period = 1.minute

config.good_job.cron = {
feed_refresh: { # each recurring job must have a unique key
cron: "every 3 hours", # cron-style scheduling format by fugit gem
class: "FeedRefresherJob", # name of the job class as a String; must reference an Active Job job class
description: "Refreshed feeds and creates new entries", # optional description that appears in Dashboard,
enabled_by_default: -> { Rails.env.production? } # Only enable in production, otherwise can be enabled manually through Dashboard
}
}

# Preserve job records for debugging
config.good_job.preserve_job_records = true
Expand All @@ -19,6 +29,7 @@
# Queue configuration
config.good_job.queues = "*"


# Smaller batch size for better performance
config.good_job.cleanup_interval_jobs = 1000
config.good_job.cleanup_interval_seconds = 600
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Rails.application.routes.draw do
resources :evidences
if Rails.env.development?
mount GoodJob::Engine => "/admin/good_job"
mount Avo::Engine => "/admin"
Expand Down