File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ implement_http_transport! {
312
312
let http_proxy = options. http_proxy. as_ref( ) . map( |x| x. to_string( ) ) ;
313
313
let https_proxy = options. https_proxy. as_ref( ) . map( |x| x. to_string( ) ) ;
314
314
315
- let mut disabled = SystemTime :: now ( ) ;
315
+ let mut disabled = None :: < SystemTime > ;
316
316
let mut handle = curl:: easy:: Easy :: new( ) ;
317
317
318
318
thread:: spawn( move || {
@@ -329,13 +329,16 @@ implement_http_transport! {
329
329
}
330
330
331
331
// while we are disabled due to rate limits, skip
332
- let now = SystemTime :: now( ) ;
333
- if let Ok ( time_left) = disabled. duration_since( now) {
334
- sentry_debug!(
335
- "Skipping event send because we're disabled due to rate limits for {}s" ,
336
- time_left. as_secs( )
337
- ) ;
338
- continue ;
332
+ if let Some ( ts) = disabled {
333
+ if let Ok ( time_left) = ts. duration_since( SystemTime :: now( ) ) {
334
+ sentry_debug!(
335
+ "Skipping event send because we're disabled due to rate limits for {}s" ,
336
+ time_left. as_secs( )
337
+ ) ;
338
+ continue ;
339
+ } else {
340
+ disabled = None ;
341
+ }
339
342
}
340
343
341
344
handle. reset( ) ;
@@ -397,7 +400,7 @@ implement_http_transport! {
397
400
. map( |x| x. as_str( ) )
398
401
. and_then( parse_retry_after)
399
402
{
400
- disabled = retry_after;
403
+ disabled = Some ( retry_after) ;
401
404
}
402
405
}
403
406
Ok ( 200 ) | Ok ( 201 ) => { }
You can’t perform that action at this time.
0 commit comments