Tags: Optimizely/Episerver Scheduled jobs

Optimizely CMS Scheduled Job «Change Log Auto Truncate» timeout

Optimizely CMS admin mode has a Change Log, where you can see a log of when content items are published, updated, moved, etc.

To limit the amount of log data in the database, the scheduled job «Change Log Auto Truncate» removes old data from this log. In CMS 11 the job can be configured like this.

<applicationSettings activityArchiveRetentionPeriod="12" />

The activityArchiveRetentionPeriod represents the number of months for which to retain activities in the archive.

I recently had a problem where the job would fail with a message like:

One or more errors occurred. 
[Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.]

The database table tblActivityLog only had about 20,000 rows.

I ran this stored procedure manually, a couple of times, to reduce the amount of data.

DECLARE	@return_value int

EXEC	@return_value = [dbo].[netActivityLogTruncate]
		@Archive = 1,
		@MaxRows = 5000,
		@BeforeEntry = NULL,
		@CreatedBefore = N'2023-07-07',
		@PreservedRelation = NULL

SELECT	'Return Value' = @return_value

GO

After that, the job was able to run!

7430 activities archived and 12090 activites deleted from the archive.

A tip from Optimizely support:

Review all jobs and automated tasks that can update content automatically. If you have any, please consider using SaveAction.Patch to prevent excessive logs from being created.