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 7024027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:47:12+00:00 2026-05-27T23:47:12+00:00

I am accustomed from PHP to set up CRON on the URL address, that

  • 0

I am accustomed from PHP to set up CRON on the URL address, that I want to run automatically in a time interval.

Now I try to set up the Schedular add-on at Heroku and I have a little problem – I created the file lib/tasks/scheduler.rake and in admin section on Heroku set up everything what is possible, but:

I am a bit confused, how it all works – for example, these lines are in lib/tasks/scheduler.rake:

desc "This task is called by the Heroku scheduler add-on"
task :update_feed => :environment do
    puts "Updating feed..."
    NewsFeed.update
    puts "done."
end

task :send_reminders => :environment do
    User.send_reminders
end

What mean the task task :update_feed? In the set up hour will be run this action? But this is action in which controller? For example, what if I would need to run every day the action my_action in the controller home? I should set up there again only my_action instead update_feed?

  • 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-27T23:47:12+00:00Added an answer on May 27, 2026 at 11:47 pm

    With a cron to call an http action, such as using curl or wget, you are scheduling an http request, and the http request then results in the php action running, and in that action’s code you have some work/logic that occurs.

    With heroku scheduler, you are skipping all the http request stuff and action stuff, and can put the logic/work into the rake task directly (or put it in a regular ruby class or model and invoke that from the task body).

    This works because the rake task is loading up the full rails environment (the :environment dependency part of the task definition does this), so inside the rake task body, you have access to your rails app models, required gems, application configuration, everything – just like inside a controller or model class in rails.

    What’s also nice, if you are on cedar, is that the scheduler invokes tasks in a one-off dynamo instance, so your app’s main dynamo is not occupied by a task run by the scheduler, which is not the case when you use the cron -> http request -> controller action pattern.

    If you tell me more about what you are trying to do, I can give more specific advice, but in general I usually have the task’s logic defined in a plain ruby class in the lib directory, or as a class method on a model, and that is what would be called from the task body (as in the example code you cite above).

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

Sidebar

Related Questions

I know that PHP doesn't yet have native Enumerations. But I have become accustomed
(Sort of a newbie question from someone that is more accustomed to how Flash/ActionScript
I have been struggling with this for quite some time having been accustomed to
EDITS corrected terminology from Intellisense to Smart Tag OK, I readily admit that Intellisense/Smart
I have a Silverlight3 application that is meant to run on both Windows and
Coming from a Django background, I'm accustomed to the framework providing a configuration mechanism
I'm accustomed to running a git comparison that will allow comparison with local git
I've grown accustomed to using IPython to try things out whilst learning Python, and
Given a pytz timezone for a particular user(calculated from his offset), i want to
I am accustomed to winform TreeView having a Sorted property which automatically manages nodes

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.