Kentico CMS 7.0 Developer's Guide

Managing synchronization tasks

Managing synchronization tasks

Previous topic Next topic Mail us feedback on this topic!  

Managing synchronization tasks

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Arrow


API examples for newer versions


Please visit the latest API Examples documentation to view API examples for newer versions of Kentico.



The following example creates a web farm synchronization task.

 

private void CreateTask()
{
    // Set the properties
    string taskTarget = "";
    string taskTextData = "MyWebFarmTask";
    byte[] taskBinaryData = null;
    WebFarmTaskTypeEnum webfarmTaskType = WebFarmTaskTypeEnum.ClearHashtables;

 
  // Create the web farm task
  WebSyncHelperClass.CreateTask(webfarmTaskType, taskTarget, taskTextData, taskBinaryData);

}

 

The following example runs all tasks assigned to the current server (the one specified in the web.config file).

 

private void RunMyTasks()
{
    WebSyncHelper.ProcessMyTasks();
}