Wednesday, December 2, 2020

Clearing the job queue in Sitecore Publishing Service

 There is no command that you can run to delete a particular publishing job or all jobs in Publishing Service.


To do that in SQL you can run the following script:


declare @JobId uniqueidentifier

declare @ManifestId uniqueidentifier


set @JobId = 'E6CF71FC-F6FA-4A38-A2FD-80B8B9426810'


SELECT @ManifestId = [ManifestId]

  FROM [dbo].[Publishing_JobManifest]

  WHERE JobId = @JobId


DELETE FROM [dbo].[Publishing_ManifestStep]

  WHERE ManifestId = @ManifestId


DELETE FROM [dbo].[Publishing_ManifestOperationResult]

  WHERE ManifestId = @ManifestId


DELETE FROM [dbo].[Publishing_ManifestStatus]

  WHERE ManifestId = @ManifestId


DELETE FROM [dbo].[Publishing_JobManifest]

  WHERE JobId = @JobId


DELETE FROM [dbo].[Publishing_JobMetadata]

  WHERE JobId = @JobId


DELETE FROM [dbo].[Publishing_JobQueue]

  WHERE JobId = @JobId