John Mitchell wrote
There are a few issues that I see with this approach however.
Using OnBeginRequest will make this check need to be done for every single request that comes through the system. Using Init would be better.
I tried using the Init however, at this point the it is still running under the AppPool user.
John Mitchell wrote
I'll need to understand it better, but it looks like you will be forcing the use of impersonation which may not be desired for everyone.
Yes I'm enforcing impercination, since I did not want to alter too much code. It should be possible to have an additinal setting within the schedule provider. This setting, could indicate what account you want it to run under. Maybe, the option of AppPool account, or Web Account.
[QUOTE]John Mitchell wrote
Taking the code from the App_start for the EventQueue will keep the messages from being processed at the time of the Event. I don't see the code to actually do the processing,
[/Quote]
True, it does not run the EventQueue code. I have done this by adding a new schedule that I wrote.
[QUOTE]John Mitchell wrote
but if you are running those same statements only daily then it changes it to be a batch process with a JobQueue.
[/Quote]
The reason I set it to run on a daily basis is that when I set it to run at AppStart. I knew that it would fail so I set it to retry after 5 minutes (thinking at this point the Website should be running under the correct account. However, when I was looking at the schedule history and when it was next ment to run, it keep increasing the time that is was suppose to run. Therefore, it never reattempted to execute the schedule
John Mitchell wrote
Those messages need to be processed in an event-driven manner to be effective since they insure that final processing is completed after new modules are uploaded. Although, if you are actually processing the messages, then that isn't the worst thing I guess.
As mentioned, I wrote a schedule to execute the EventQueue code that should be ran in the AppStart. But as I said before, having it retry after 5 minutes was not working (i.e. it never ran). I'm not saying that this is the best solution. However, it works for the time being. Until the core team manage to figure out a better solution.
Ken