changes queues & db pool
This commit is contained in:
parent
0c72858116
commit
64fae88e53
2
Procfile
2
Procfile
|
@ -1,2 +1,2 @@
|
||||||
server: bin/rails server -p 3000 -b 0.0.0.0
|
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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class E621ExportDownloadJob < ApplicationJob
|
class E621ExportDownloadJob < ApplicationJob
|
||||||
queue_as :default
|
queue_as :exports
|
||||||
|
|
||||||
def perform(type)
|
def perform(type)
|
||||||
date = Time.zone.now.strftime("%Y-%m-%d")
|
date = Time.zone.now.strftime("%Y-%m-%d")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class E621ExportsJob < ApplicationJob
|
class E621ExportsJob < ApplicationJob
|
||||||
queue_as :low_priority
|
queue_as :exports
|
||||||
|
|
||||||
def perform
|
def perform
|
||||||
E621.constants.map { |c| E621.const_get(c) }.filter { |c| c < ApplicationRecord }.each do |type|
|
E621.constants.map { |c| E621.const_get(c) }.filter { |c| c < ApplicationRecord }.each do |type|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class E621PoolImportJob < ApplicationJob
|
class E621PoolImportJob < ApplicationJob
|
||||||
queue_as :default
|
queue_as :exports
|
||||||
|
|
||||||
def perform
|
def perform
|
||||||
PoolIndex.create_index!(delete_existing: true)
|
PoolIndex.create_index!(delete_existing: true)
|
||||||
|
|
|
@ -5,8 +5,6 @@ class GitJob < ApplicationJob
|
||||||
|
|
||||||
queue_as :git
|
queue_as :git
|
||||||
|
|
||||||
good_job_control_concurrency_with(perform_limit: 1)
|
|
||||||
|
|
||||||
def perform(identifier, base_path, *commands)
|
def perform(identifier, base_path, *commands)
|
||||||
commands.each do |command|
|
commands.each do |command|
|
||||||
system!(command, path: base_path)
|
system!(command, path: base_path)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UpdateE621PoolTagsJob < ApplicationJob
|
class UpdateE621PoolTagsJob < ApplicationJob
|
||||||
queue_as :default
|
queue_as :exports
|
||||||
|
|
||||||
def perform(pool_id)
|
def perform(pool_id)
|
||||||
pool = E621::Pool.find(pool_id)
|
pool = E621::Pool.find(pool_id)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UpdateExternalCacheJob < ApplicationJob
|
class UpdateExternalCacheJob < ApplicationJob
|
||||||
queue_as :low_priority
|
queue_as :cache
|
||||||
|
|
||||||
def perform(image)
|
def perform(image)
|
||||||
image.update_cache!
|
image.update_cache!
|
||||||
|
|
|
@ -81,5 +81,6 @@ test:
|
||||||
#
|
#
|
||||||
production:
|
production:
|
||||||
<<: *default
|
<<: *default
|
||||||
database: websites_production
|
database: websites
|
||||||
password: <%= ENV["WEBSITES_DATABASE_PASSWORD"] %>
|
password: <%= ENV["WEBSITES_DATABASE_PASSWORD"] %>
|
||||||
|
pool: <%= ENV.fetch("WEBSITES_DATABASE_POOL") { 10 } %>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user