Browse Source
Merge pull request #24387 from abpframework/auto-merge/rel-10-0/4194
Merge branch dev with rel-10.0
pull/24413/head
Ma Liming
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
25 additions and
1 deletions
-
framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/TelemetryService.cs
|
|
|
@ -67,7 +67,7 @@ public class TelemetryService : ITelemetryService, IScopedDependency |
|
|
|
|
|
|
|
private Task AddActivityAsync(ActivityContext context) |
|
|
|
{ |
|
|
|
_ = Task.Run(async () => |
|
|
|
var telemetryTask = Task.Run(async () => |
|
|
|
{ |
|
|
|
using var scope = _serviceScopeFactory.CreateScope(); |
|
|
|
|
|
|
|
@ -81,6 +81,30 @@ public class TelemetryService : ITelemetryService, IScopedDependency |
|
|
|
telemetryActivitySender); |
|
|
|
}); |
|
|
|
|
|
|
|
AppDomain.CurrentDomain.ProcessExit += (_, _) => |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
telemetryTask.Wait(TimeSpan.FromSeconds(10)); |
|
|
|
} |
|
|
|
catch |
|
|
|
{ |
|
|
|
// ignored
|
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
Console.CancelKeyPress += (_, _) => |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
telemetryTask.Wait(TimeSpan.FromSeconds(10)); |
|
|
|
} |
|
|
|
catch |
|
|
|
{ |
|
|
|
// ignored
|
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
return Task.CompletedTask; |
|
|
|
} |
|
|
|
|
|
|
|
|