Sitecore Database Agent

From my last few posts, I have been talking about the Sitecore Tasks. Using the Sitecore Tasks allow a user to either set the task as synchronous or asynchronous. It is the Sitecore.Tasks.DatabaseAgent which runs at a define interval and loops through the container /sitecore/system/tasks/schedules.

When jobs are being executed, if it is synchronous, the entry in the jobs.aspx page will be as Master_Database_Agent (5 of 7). This means that of the 7 jobs that has been scheduled, it is at the 5th task.

What is the 4th, 5th or 7th task?

Right now, we don’t know which task is being executed unless we go and check the logs. You just need to make sure that the logger level is INFO. This is a Sitecore out of the box functionality.

But from a usability perspective, you will want to have the name of the task being executed when you check the jobs.aspx page. I will be explaining on how you can add the name of the task to the jobs.aspx page.

First, you need to extend the current Tasks.DatabaseAgent class.

The main change in the code is at line 41. The change will only apply for synchronous tasks.

Once you have that piece of code ready, you will need to change jobs.aspx code behind page to add the job display name. You can read my article on how to update the current jobs.aspx page.

Lastly, you need to update the config file to make Sitecore use the new method you implemented.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s