Rails Cron (rails_cron)
First release 0.1.0 is empty gem.
A Rails gem to manage cron jobs in a simple and efficient way that is not tied to any specific background job processor.
- 📦 gem:
rails_cron/
Install the gem
# Gemfile
gem 'rails_cron'
# Install the gem
bundle install
# Generate the initializer and migrations
bin/rails g rails_cron:install
Links
- Installation & Setup for how to install the
rails_crongem, configure it. - Configuration Options for a comprehensive list of configuration options available in the
rails_crongem. - Usage & Examples section for detailed guides on configuring and using the
rails_crongem. - FAQ / Troubleshooting for answers to common questions and troubleshooting tips when working with the
rails_crongem.
Features
- Scheduler-agnostic: Works with any job system (
ActiveJob,Sidekiq,Resque, etc.) - Multi-node safe: Ensures single-dispatch execution across all app instances
- Lock adapters: Redis (
SET NX PX) and Postgres (pg_try_advisory_lock), plus in-memory fallback - Registry & API: Centralized job registration with deterministic idempotency keys
- Dispatch recovery: Replays missed runs within a configurable lookback window
- Cron utilities: Validate, lint, simplify (
@daily), humanize, and translate via i18n - i18n keys: Fully localizable weekdays, months, and time phrases (
rails_cron.*) - CLI tools:
rails-crons explain,next,run, and Rails Rake tasks (rails_cron:start,status, etc.) - Standalone mode: Launch scheduler via Procfile, systemd, or Kubernetes
- Rails integration: Railtie auto-loads configuration and Rake tasks
- Observability: Optional status inspection via
rails_cron:status - Graceful shutdown: Handles
TERM/INTsignals and finishes current tick cleanly - Testing: Thread-safe, multi-node safety specs included
- Development & CI: Bundler, RSpec, RuboCop, GitHub Actions workflows
- Documentation: README, feature templates, and roadmap included
Professional support
Need help with integrating or customizing rails_cron for your project? We offer professional support and custom development services. Contact us at sales@codevedas.com for inquiries.
License
MIT © Codevedas Inc.