Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6695619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:14:37+00:00 2026-05-26T06:14:37+00:00

I am using whenever(https://github.com/javan/whenever) ruby gem to insert a crontab entry in after_create callback

  • 0

I am using whenever(https://github.com/javan/whenever) ruby gem to insert a crontab entry in after_create callback of model X. This entry instructs the job to run every 45 minutes. But I want to give the control to the user where by he can specify the time interval. So the process goes like this:

  1. The user creates a Model X, I insert a crontab entry to execute a job after 45 minutes.
  2. User sees that 45 minutes is not good enough, he wants to be able to change the time interval from UI to 30 minutes (please note that this is a HTML/UI control where he should be able to do that).
  3. Later on he should be able to change the time interval any number of times.

Any gem or any idea on how we can accomplish this is appreciated. I am open to any version of rails and can start implementation in anyone since this feature forms the core of functionality.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:14:37+00:00Added an answer on May 26, 2026 at 6:14 am

    I don’t like the approach of your solution. It means, that if in the future your application will have 2k users, you’ll start 2k crontabs?

    Instead of creating one crontab for every user, simply create one every minute. Store in the User model the information about the crontab frequency for that user and the last time the crontab was performed.

    Then, when the main crontab starts every minute, check which users have a last_crontab_at + frequency < Time.current and run the script for these users.

    In this way, the application will scale regardless the number of users.

    Also, remember crontabs are local to the server. What will happen if you have to change the server or create a cluster? I suggest you to think about using a background processing service or a queue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using the endless adapter http://github.com/commonsguy/cwac-endless however whenever i return false (because i dont
Im using Karl Swedberg's jquery smooth scrolling plugin for same page links: https://github.com/kswedberg/jquery-smooth-scroll The
I'm using version 2.1 of Aquamacs and django-mode from https://github.com/myfreeweb/django-mode . I installed it
I've seen several other posts similar to this (namely https://stackoverflow.com/questions/5237/solutions-for-working-with-multiple-branches-in-asp-net ) but there are
I am using TinyMCE ( http://tinymce.moxiecode.com/ ) in a .NET page. Whenever I load
I am using the sample code of paypal in php from https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_code but whenever
I am using apache on Centos and whenever I use domain.com it gets redirected
Whenever I start a shell in vim using :sh, it doesn't source my ~/.bashrc
Whenever I try to copy an entire working copy using simple drag and drop
i'm using the DOMdocument class in php whenever i want to create a XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.