From 804ccd4fccae9136b1ac234141818998ecfcc447 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 21 Aug 2019 18:02:55 -0500 Subject: [PATCH] capistrano: fix cronjobs not updating. Bug: capistrano didn't update the crontab during deployment. As a result the crontab still referenced an old deployment. Eventually that deployment was deleted and cronjobs started silently failing. Broken in 223e5f1e8. Turns out that `whenever` defaults to running on servers with the `db` role. Removing kagamihara from the db role meant that whenever was no longer configured to run anywhere. --- config/deploy.rb | 2 ++ config/deploy/production.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index 4ecdfd466..ea3d0cd27 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -12,5 +12,7 @@ set :conditionally_migrate, true # run migrations on the primary app server set :migration_role, :app +set :whenever_roles, :cron + # how long unicorn:legacy_restart (used by deploy:rolling) waits until killing the old unicorn. set :unicorn_restart_sleep_time, 10 diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 006ccbefe..e4dcc5e6b 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -2,7 +2,7 @@ set :user, "danbooru" set :rails_env, "production" append :linked_files, ".env.production" -server "kagamihara", :roles => %w(web app), :primary => true +server "kagamihara", :roles => %w(web app cron), :primary => true server "shima", :roles => %w(web app) server "saitou", :roles => %w(web app) server "oogaki", :roles => %w(worker)