File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ implement_http_transport! {
312312 let http_proxy = options. http_proxy. as_ref( ) . map( |x| x. to_string( ) ) ;
313313 let https_proxy = options. https_proxy. as_ref( ) . map( |x| x. to_string( ) ) ;
314314
315- let mut disabled = SystemTime :: now ( ) ;
315+ let mut disabled = None :: < SystemTime > ;
316316 let mut handle = curl:: easy:: Easy :: new( ) ;
317317
318318 thread:: spawn( move || {
@@ -329,13 +329,16 @@ implement_http_transport! {
329329 }
330330
331331 // 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+ }
339342 }
340343
341344 handle. reset( ) ;
@@ -397,7 +400,7 @@ implement_http_transport! {
397400 . map( |x| x. as_str( ) )
398401 . and_then( parse_retry_after)
399402 {
400- disabled = retry_after;
403+ disabled = Some ( retry_after) ;
401404 }
402405 }
403406 Ok ( 200 ) | Ok ( 201 ) => { }
You can’t perform that action at this time.
0 commit comments