In SharePoint we have a provision to report the progress of a timer job. I was wondering how do various SharePoint inbuilt timer jobs’s report the status of the timer job.
Thankfully to the API method provided SPJobDefinition.UpdateProgress method which accepts integer as a parameter.
You can use this method to call in SPJobDefinition.Execute method or any other method that is called in the Execute method directly or indirectly.
Example:
public override void Execute(Guid contentDbId){ //some code this.UpdateProgress(<number lies between 0 to 100>); }
I find this method new to my knowledge, so I shared. Hope this helps.
Advertisements
Reblogged this on Sutoprise Avenue, A SutoCom Source.