Do you SharePoint?

Let's talk about it.
posts - 19, comments - 8, trackbacks - 0

SharePoint Timer Service and custom jobs

When deploying custom SPOneTimeSchedule job definitions sometimes the timer service (OWSTIMER.EXE) just sorta sits there. Your job definition is created, but isn't executed. It will most likely eventually run, but I have better things to do than sit around wait for it. Setting the time for the job in the past seems to move things along faster.

// Create new job
CustomJob MyJob = new CustomJob(Constants.JOB_NAME, webApp, properties.Definition.DisplayName);
MyJob.Title = Constants.JOB_TITLE;

// Set up the job to run once
MyJob.Schedule = new SPOneTimeSchedule(DateTime.Now.AddHours(-4));
MyJob.Update();

Print | posted on Wednesday, October 29, 2008 12:17 PM | Filed Under [ Development WSS 3.0 MOSS 2007 ]

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 6 and 2 and type the answer here:

Powered by: