mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-17 01:56:22 +00:00
feat: iniciar que en segundo plano
This commit is contained in:
parent
39e997d0ca
commit
cfc85e6356
4 changed files with 12 additions and 5 deletions
1
Procfile
1
Procfile
|
@ -1,2 +1,3 @@
|
||||||
cleanup: bundle exec rake cleanup:everything
|
cleanup: bundle exec rake cleanup:everything
|
||||||
stats: bundle exec rake stats:process_all
|
stats: bundle exec rake stats:process_all
|
||||||
|
que: daemonize -c /srv/ -p /srv/tmp/que.pid -u rails /usr/local/bin/syslogize bundle exec que
|
||||||
|
|
|
@ -38,6 +38,13 @@ module Sutty
|
||||||
|
|
||||||
config.active_storage.variant_processor = :vips
|
config.active_storage.variant_processor = :vips
|
||||||
|
|
||||||
|
# Que
|
||||||
|
config.action_mailer.deliver_later_queue_name = :default
|
||||||
|
config.active_storage.queues.analysis = :default
|
||||||
|
config.active_storage.queues.purge = :default
|
||||||
|
config.active_job.queue_adapter = :que
|
||||||
|
config.active_job.queue_name_prefix = "sutty_#{Rails.env}"
|
||||||
|
|
||||||
config.to_prepare do
|
config.to_prepare do
|
||||||
# Load application's model / class decorators
|
# Load application's model / class decorators
|
||||||
Dir.glob(File.join(File.dirname(__FILE__), '..', 'app', '**', '*_decorator.rb')).sort.each do |c|
|
Dir.glob(File.join(File.dirname(__FILE__), '..', 'app', '**', '*_decorator.rb')).sort.each do |c|
|
||||||
|
|
|
@ -64,11 +64,6 @@ Rails.application.configure do
|
||||||
# Use a different cache store in production.
|
# Use a different cache store in production.
|
||||||
config.cache_store = :redis_cache_store, { url: ENV['REDIS_SERVER'] }
|
config.cache_store = :redis_cache_store, { url: ENV['REDIS_SERVER'] }
|
||||||
|
|
||||||
# Use a real queuing backend for Active Job (and separate queues per
|
|
||||||
# environment)
|
|
||||||
config.active_job.queue_adapter = :que
|
|
||||||
config.active_job.queue_name_prefix = "sutty_#{Rails.env}"
|
|
||||||
|
|
||||||
config.action_mailer.perform_caching = false
|
config.action_mailer.perform_caching = false
|
||||||
|
|
||||||
# Ignore bad email addresses and do not raise email delivery errors.
|
# Ignore bad email addresses and do not raise email delivery errors.
|
||||||
|
|
|
@ -13,3 +13,7 @@ check program stats
|
||||||
with path "/usr/bin/foreman run -f /srv/Procfile -d /srv stats" as uid "rails" gid "www-data"
|
with path "/usr/bin/foreman run -f /srv/Procfile -d /srv stats" as uid "rails" gid "www-data"
|
||||||
every "0 1 * * *"
|
every "0 1 * * *"
|
||||||
if status != 0 then alert
|
if status != 0 then alert
|
||||||
|
|
||||||
|
check process que with pidfile /srv/tmp/que.pid
|
||||||
|
start program = "/usr/bin/foreman run -f /srv/Procfile -d /srv que"
|
||||||
|
stop program = "/bin/sh -c 'cat /srv/tmp/que.pid | xargs -r kill'"
|
||||||
|
|
Loading…
Reference in a new issue