cron task best practices
- use
whenever
manage crontab schedule - use rake to execute task. the task don't be to heavy, move complex part to
service object
ormodel
- make task log in a separate file
use exception monitor like sentry
if your task is very busy. such as 1/mins times. you should consider
sidekiq-cron
,it can avoid rails env be loaded frequently.
Written by lazybios
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#