changes queues & db pool

This commit is contained in:
Donovan Daniels 2024-10-24 03:07:27 -05:00
parent 0c72858116
commit 64fae88e53
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA
8 changed files with 8 additions and 9 deletions

View File

@ -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

View File

@ -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")

View File

@ -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|

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
class UpdateExternalCacheJob < ApplicationJob
queue_as :low_priority
queue_as :cache
def perform(image)
image.update_cache!

View File

@ -81,5 +81,6 @@ test:
#
production:
<<: *default
database: websites_production
database: websites
password: <%= ENV["WEBSITES_DATABASE_PASSWORD"] %>
pool: <%= ENV.fetch("WEBSITES_DATABASE_POOL") { 10 } %>