Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How to start a scheduled task from module codeHow to start a scheduled task from module code
Previous
 
Next
New Post
2/23/2010 1:34 PM
 

I have a custom module containing code for a custom scheduled task (from guide here). The scheduled task works fine when run by the scheduler, but now I have a new requirement:

I want to kick start the scheduled task from my module code. In case you are wondering why - the scheduled task calls a rather long running process which I want to execute in a separate thread to the thread the module code runs in).

I haven't found a way through the API to do this ..... does anyone have a tip?

Many thanks.

 
New Post
3/1/2010 5:26 AM
 
I figured out a solution. To start a scheduled task. just enable it and update it. The act of updating any scheduled task causes it to be queued to run imediately. However, you have to use the DNNScheduler object to do the update; SchedulingController also contains an update method but this just changes the task's properties and doesn't queue the task to run. SchedulingController sc = new SchedulingController(); ScheduleItem si = sc.GetSchedule(ScheduleItemName, ""); DNNScheduler ds = new DNNScheduler(); ds.UpdateSchedule(si);
 
New Post
12/24/2012 3:27 PM
 
using DotNetNuke.Services.Scheduling;
...
public void RunSchedule()
{
SchedulingProvider scheduler = SchedulingProvider.Instance();
ScheduleItem si = scheduler.GetSchedule("FullAssemblyNameOfSchedule", "");
scheduler.RunScheduleItemNow(si);
}
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How to start a scheduled task from module codeHow to start a scheduled task from module code


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out