U4-9201 - fix it all

This commit is contained in:
Stephan
2016-11-23 15:26:41 +01:00
parent 3300dbbe5e
commit 0689bf4f31
7 changed files with 56 additions and 43 deletions

View File

@@ -78,7 +78,7 @@ namespace Umbraco.Web.Scheduling
}
// running on a background task, requires a safe database (see UsingSafeDatabase doc)
using (ApplicationContext.Current.DatabaseContext.UsingSafeDatabase)
using (ApplicationContext.Current.DatabaseContext.UseSafeDatabase(true))
using (DisposableTimer.DebugDuration<LogScrubber>("Log scrubbing executing", "Log scrubbing complete"))
{
Log.CleanLogs(GetLogScrubbingMaximumAge(_settings));

View File

@@ -83,10 +83,8 @@ namespace Umbraco.Web.Scheduling
};
// running on a background task, requires a safe database (see UsingSafeDatabase doc)
//
// this is because GetAuthenticationHeaderValue uses UserService to load the current user, hence requires a database
//
using (ApplicationContext.Current.DatabaseContext.UsingSafeDatabase)
// (GetAuthenticationHeaderValue uses UserService to load the current user, hence requires a database)
using (ApplicationContext.Current.DatabaseContext.UseSafeDatabase(true))
{
//pass custom the authorization header
request.Headers.Authorization = AdminTokenAuthorizeAttribute.GetAuthenticationHeaderValue(_appContext);