File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Umbraco.Infrastructure/HostedServices
Umbraco.Web.Common/DependencyInjection Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 2
2
using System . Net . Http ;
3
3
using System . Text ;
4
4
using System . Threading . Tasks ;
5
+ using Microsoft . Extensions . DependencyInjection ;
5
6
using Microsoft . Extensions . Logging ;
7
+ using Microsoft . Extensions . Options ;
6
8
using Newtonsoft . Json ;
9
+ using Umbraco . Cms . Core . Configuration ;
10
+ using Umbraco . Cms . Core . Configuration . Models ;
7
11
using Umbraco . Cms . Core . Telemetry ;
8
12
using Umbraco . Cms . Core . Telemetry . Models ;
13
+ using Umbraco . Cms . Web . Common . DependencyInjection ;
9
14
10
15
namespace Umbraco . Cms . Infrastructure . HostedServices
11
16
{
@@ -25,6 +30,15 @@ public ReportSiteTask(
25
30
s_httpClient = new HttpClient ( ) ;
26
31
}
27
32
33
+ [ Obsolete ( "Use the constructor that takes ITelemetryService instead, scheduled for removal in V11" ) ]
34
+ public ReportSiteTask (
35
+ ILogger < ReportSiteTask > logger ,
36
+ IUmbracoVersion umbracoVersion ,
37
+ IOptions < GlobalSettings > globalSettings )
38
+ : this ( logger , StaticServiceProvider . Instance . GetRequiredService < ITelemetryService > ( ) )
39
+ {
40
+ }
41
+
28
42
/// <summary>
29
43
/// Runs the background task to send the anonymous ID
30
44
/// to telemetry service
Original file line number Diff line number Diff line change 28
28
using Umbraco . Cms . Core . Configuration . Models ;
29
29
using Umbraco . Cms . Core . DependencyInjection ;
30
30
using Umbraco . Cms . Core . Diagnostics ;
31
- using Umbraco . Cms . Core . Events ;
32
31
using Umbraco . Cms . Core . Hosting ;
33
32
using Umbraco . Cms . Core . Logging ;
34
33
using Umbraco . Cms . Core . Macros ;
35
34
using Umbraco . Cms . Core . Net ;
36
35
using Umbraco . Cms . Core . Notifications ;
37
36
using Umbraco . Cms . Core . Security ;
38
37
using Umbraco . Cms . Core . Services ;
38
+ using Umbraco . Cms . Core . Telemetry ;
39
39
using Umbraco . Cms . Core . Templates ;
40
40
using Umbraco . Cms . Core . Web ;
41
41
using Umbraco . Cms . Core . WebAssets ;
@@ -182,7 +182,10 @@ public static IUmbracoBuilder AddHostedServices(this IUmbracoBuilder builder)
182
182
builder . Services . AddHostedService < TempFileCleanup > ( ) ;
183
183
builder . Services . AddHostedService < InstructionProcessTask > ( ) ;
184
184
builder . Services . AddHostedService < TouchServerTask > ( ) ;
185
- builder . Services . AddHostedService < ReportSiteTask > ( ) ;
185
+ builder . Services . AddHostedService ( provider =>
186
+ new ReportSiteTask (
187
+ provider . GetRequiredService < ILogger < ReportSiteTask > > ( ) ,
188
+ provider . GetRequiredService < ITelemetryService > ( ) ) ) ;
186
189
return builder ;
187
190
}
188
191
You can’t perform that action at this time.
0 commit comments