File tree Expand file tree Collapse file tree 1 file changed +19
-15
lines changed
Hi3Helper.Core/Classes/SentryHelper Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -168,21 +168,25 @@ public static void InitializeSentrySdk()
168168 /// </summary>
169169 public static void StopSentrySdk ( )
170170 {
171- try
172- {
173- SentrySdk . Flush ( TimeSpan . FromSeconds ( 5 ) ) ;
174- SentrySdk . EndSession ( ) ;
175- ReleaseExceptionRedirect ( ) ;
176- }
177- catch ( Exception ex )
178- {
179- Logger . LogWriteLine ( $ "Failed when preparing to stop SentryInstance, Dispose will still be invoked!\r \n { ex } "
180- , LogType . Error , true ) ;
181- }
182- finally
183- {
184- _sentryInstance ? . Dispose ( ) ;
185- }
171+ _ = Task . Run ( async ( ) =>
172+ {
173+ try
174+ {
175+ await SentrySdk . FlushAsync ( TimeSpan . FromSeconds ( 5 ) ) ;
176+ SentrySdk . EndSession ( ) ;
177+ ReleaseExceptionRedirect ( ) ;
178+ }
179+ catch ( Exception ex )
180+ {
181+ Logger
182+ . LogWriteLine ( $ "Failed when preparing to stop SentryInstance, Dispose will still be invoked!\r \n { ex } ",
183+ LogType . Error , true ) ;
184+ }
185+ finally
186+ {
187+ _sentryInstance ? . Dispose ( ) ;
188+ }
189+ } ) ;
186190 }
187191
188192 public static void InitializeExceptionRedirect ( )
You can’t perform that action at this time.
0 commit comments