diff --git a/Procfile b/Procfile index 7c620e8..e0950ed 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ server: bin/rails server -p 3000 -b 0.0.0.0 -jobs: GOOD_JOB_MAX_THREADS=16 bundle exec good_job start +jobs: GOOD_JOB_MAX_THREADS=8 GOOD_JOB_QUEUES="low_priority:3;exports:2;default:5;git:1;iqdb:5;cache:2" bundle exec good_job start diff --git a/app/jobs/e621_export_download_job.rb b/app/jobs/e621_export_download_job.rb index 5c9255e..d0937cb 100644 --- a/app/jobs/e621_export_download_job.rb +++ b/app/jobs/e621_export_download_job.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class E621ExportDownloadJob < ApplicationJob - queue_as :default + queue_as :exports def perform(type) date = Time.zone.now.strftime("%Y-%m-%d") diff --git a/app/jobs/e621_exports_job.rb b/app/jobs/e621_exports_job.rb index f57cb50..378a9a5 100644 --- a/app/jobs/e621_exports_job.rb +++ b/app/jobs/e621_exports_job.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class E621ExportsJob < ApplicationJob - queue_as :low_priority + queue_as :exports def perform E621.constants.map { |c| E621.const_get(c) }.filter { |c| c < ApplicationRecord }.each do |type| diff --git a/app/jobs/e621_pool_import_job.rb b/app/jobs/e621_pool_import_job.rb index 8db830e..a5d717e 100644 --- a/app/jobs/e621_pool_import_job.rb +++ b/app/jobs/e621_pool_import_job.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class E621PoolImportJob < ApplicationJob - queue_as :default + queue_as :exports def perform PoolIndex.create_index!(delete_existing: true) diff --git a/app/jobs/git_job.rb b/app/jobs/git_job.rb index 6d4a3a4..e2cf1f7 100644 --- a/app/jobs/git_job.rb +++ b/app/jobs/git_job.rb @@ -5,8 +5,6 @@ class GitJob < ApplicationJob queue_as :git - good_job_control_concurrency_with(perform_limit: 1) - def perform(identifier, base_path, *commands) commands.each do |command| system!(command, path: base_path) diff --git a/app/jobs/update_e621_pool_tags_job.rb b/app/jobs/update_e621_pool_tags_job.rb index 47a5b23..640716e 100644 --- a/app/jobs/update_e621_pool_tags_job.rb +++ b/app/jobs/update_e621_pool_tags_job.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class UpdateE621PoolTagsJob < ApplicationJob - queue_as :default + queue_as :exports def perform(pool_id) pool = E621::Pool.find(pool_id) diff --git a/app/jobs/update_external_cache_job.rb b/app/jobs/update_external_cache_job.rb index 3a1a202..c53a06a 100644 --- a/app/jobs/update_external_cache_job.rb +++ b/app/jobs/update_external_cache_job.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class UpdateExternalCacheJob < ApplicationJob - queue_as :low_priority + queue_as :cache def perform(image) image.update_cache! diff --git a/config/database.yml b/config/database.yml index f737e1d..83c1070 100644 --- a/config/database.yml +++ b/config/database.yml @@ -81,5 +81,6 @@ test: # production: <<: *default - database: websites_production + database: websites password: <%= ENV["WEBSITES_DATABASE_PASSWORD"] %> + pool: <%= ENV.fetch("WEBSITES_DATABASE_POOL") { 10 } %>