ApplicationEventHandler ApplicationStarted times executed?
I'm wonder how many times the ApplicationStarted event is triggered?
IIS puts your application to "sleep" when inactive, will it trigger the event again when your first visitor is browing to the site and IIS is rebooting your application?
public class RegisterEvents : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
MyAwesomeMethod();
}
}
I want to clean up nodes that are older than a day. I was thinking of doing it in the ApplicationStarted eventhandler instead of a scheduled task.
ApplicationEventHandler ApplicationStarted times executed?
I'm wonder how many times the ApplicationStarted event is triggered? IIS puts your application to "sleep" when inactive, will it trigger the event again when your first visitor is browing to the site and IIS is rebooting your application?
I want to clean up nodes that are older than a day. I was thinking of doing it in the ApplicationStarted eventhandler instead of a scheduled task.
Any ideas?
Yes it will trigger every time.
If you want to clean up, don't do it on application startup because that will make your startup slower. Scheduled tasks suit the job better.
is working on a reply...