Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I "namespace" the crontab entries? #828

Open
davidkrider opened this issue Oct 15, 2022 · 0 comments
Open

How do I "namespace" the crontab entries? #828

davidkrider opened this issue Oct 15, 2022 · 0 comments

Comments

@davidkrider
Copy link

davidkrider commented Oct 15, 2022

The documentation here (for Capistrano3) says to do this at the bottom of deploy.rb.

set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" }

I've done this, but I do not understand how to "namespace the crontab entries." Can someone give me an example of how to do modify my schedule.rb to reflect this "namespace?" (I'm trying to get my whenever entries to NOT run in staging.)

Sorry if this is a stupid question, but I've tried about a half dozen things to make this work, but none of them seem to be up to date, and I can't find an example of this approach.

I have this, but it still creates crontab entries in staging with cap staging whenever:update_crontab:

set :output, "#{path}/log/whenever.log"
env "MAILTO", "david.krider@company.com"

namespace :widget_whammer_production do

  every 1.week do
    runner "FeaturizationNotificationJob.perform_now"
  end

end

Additionally, when doing cap production deploy, I get this error:

/var/www/apps/widget_whammer/shared/bundle/ruby/2.5.0/gems/whenever-1.0.0/lib/whenever/job_list.rb:37:in `method_missing': undefined method `namespace'… from config/schedule.rb:25:in `initialize'

So something is different between cap <stage> deploy vs. cap <stage> whenever:<command>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant