Not creating staging task for page updates through a scheduled task

Kàren Vaganyan asked on September 4, 2019 17:38

I have a scheduled task that runs every night that makes data updates to many pages on my site. Of course because of those updates, the next day there are hundreds of staging tasks waiting to be synced. Is there a way in my scheduled task to stop it from creating a staging task for the updates I'm making? I'm using 10.0.51

Correct Answer

Trevor Fayas answered on September 4, 2019 19:17

Yes, you can use a custom CMS Action Context, the code within will be in that context:

using(CMSActionContext context = new CMSActionContext()
            LogSynchronization = false
            // Code here will not log synchronization tasks
3 votesVote for this answer Unmark Correct answer

Recent Answers

vasu yerramsetti answered on September 4, 2019 17:55

  1. Did you check the event logs for initial troubleshooting this issue?
  2. Are you verify content staging settings are enabled or not?
0 votesVote for this answer Mark as a Correct answer

Kàren Vaganyan answered on September 4, 2019 21:57

Thanks Trevor! Worked like a charm!

Here is the exact syntax that worked for me in case anyone is looking for it.

using (new CMSActionContext() { LogSynchronization = false })
    //Some code...
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.