Skip to content

Don't write crontab in certain environment

Eduard Bondarenko edited this page Feb 25, 2020 · 1 revision

From https://github.com/javan/whenever/issues/716

Q: We don't want use whenever in staging env, can we deactivate whenever for an environment ?

A: Yes, just set the role to nil based on the capistrano stage, something like this:

set :whenever_roles, -> { stage == :staging ? nil : :db }