Skip to content

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

Description

@davidkrider

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions