Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Implementing a Scheduled Task


Reply

10 Posts   6275 Views

Avatar
SS_Learner

23 July 2012 at 3:27pm Community Member, 18 Posts

Hello Friends

I have a question to ask you about the scheduling of task.
I have made a process to run daily..
for that i have create a folder in my root Cal\code\Controller\task
which is having the following code as u provided in the example

class MyTask extends DailyTask {

function process() {
Product::updatePrice();
}
}

Can u tell me please as how can i test this in a browser manually as i am doing this in my localhost.

Any help is appreciated...

Avatar
Willr

23 July 2012 at 6:28pm Forum Moderator, 5511 Posts

Can u tell me please as how can i test this in a browser manually as i am doing this in my localhost.

You can't with DailyTasks. Though you can still run this through a terminal

sake /DailyTask

If you make you task a subclass of BuildTask you can run it both through the web and terminal

http://yoursite.dev/dev/tasks/YourTaskName
sake dev/tasks/YourTaskName