Scope - forgot to complete some scopes
This commit is contained in:
@@ -79,10 +79,11 @@ namespace Umbraco.Web.Scheduling
|
||||
|
||||
// running on a background task, and Log.CleanLogs uses the old SqlHelper,
|
||||
// better wrap in a scope and ensure it's all cleaned up and nothing leaks
|
||||
using (ApplicationContext.Current.ScopeProvider.CreateScope())
|
||||
using (var scope = ApplicationContext.Current.ScopeProvider.CreateScope())
|
||||
using (DisposableTimer.DebugDuration<LogScrubber>("Log scrubbing executing", "Log scrubbing complete"))
|
||||
{
|
||||
Log.CleanLogs(GetLogScrubbingMaximumAge(_settings));
|
||||
scope.Complete();
|
||||
}
|
||||
|
||||
return true; // repeat
|
||||
|
||||
@@ -85,10 +85,11 @@ namespace Umbraco.Web.Scheduling
|
||||
// running on a background task, requires its own (safe) scope
|
||||
// (GetAuthenticationHeaderValue uses UserService to load the current user, hence requires a database)
|
||||
// (might not need a scope but we don't know really)
|
||||
using (ApplicationContext.Current.ScopeProvider.CreateScope())
|
||||
using (var scope = ApplicationContext.Current.ScopeProvider.CreateScope())
|
||||
{
|
||||
//pass custom the authorization header
|
||||
request.Headers.Authorization = AdminTokenAuthorizeAttribute.GetAuthenticationHeaderValue(_appContext);
|
||||
scope.Complete();
|
||||
}
|
||||
|
||||
var result = await wc.SendAsync(request, token);
|
||||
|
||||
Reference in New Issue
Block a user