Skip to content

Instantly share code, notes, and snippets.

@splessons
Created December 13, 2013 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save splessons/7942652 to your computer and use it in GitHub Desktop.
Save splessons/7942652 to your computer and use it in GitHub Desktop.
private bool CreateJob(SPWebApplication site)
{
bool jobCreated = false;
try
{
SPTImerJobClass job = new SPTImerJobClass(JobName, site);
SPMinuteSchedule schedule = new SPMinuteSchedule();
schedule.BeginSecond = 0;
schedule.EndSecond = 59;
schedule.Interval = 15;
job.Schedule = schedule;
job.Update();
}
catch (Exception)
{
return jobCreated;
}
return jobCreated;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment