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 @@ -230,7 +230,7 @@ implement_http_transport! {
230
230
} ;
231
231
let client = client. build( ) . unwrap( ) ;
232
232
233
- let mut disabled = SystemTime :: now ( ) ;
233
+ let mut disabled = None :: < SystemTime > ;
234
234
235
235
thread:: Builder :: new( )
236
236
. name( "sentry-transport" . to_string( ) )
@@ -248,13 +248,16 @@ implement_http_transport! {
248
248
}
249
249
250
250
// while we are disabled due to rate limits, skip
251
- let now = SystemTime :: now( ) ;
252
- if let Ok ( time_left) = disabled. duration_since( now) {
253
- sentry_debug!(
254
- "Skipping event send because we're disabled due to rate limits for {}s" ,
255
- time_left. as_secs( )
256
- ) ;
257
- continue ;
251
+ if let Some ( ts) = disabled {
252
+ if let Ok ( time_left) = ts. duration_since( SystemTime :: now( ) ) {
253
+ sentry_debug!(
254
+ "Skipping event send because we're disabled due to rate limits for {}s" ,
255
+ time_left. as_secs( )
256
+ ) ;
257
+ continue ;
258
+ } else {
259
+ disabled = None ;
260
+ }
258
261
}
259
262
260
263
match client
@@ -271,7 +274,7 @@ implement_http_transport! {
271
274
. and_then( |x| x. to_str( ) . ok( ) )
272
275
. and_then( parse_retry_after)
273
276
{
274
- disabled = retry_after;
277
+ disabled = Some ( retry_after) ;
275
278
}
276
279
}
277
280
}
You can’t perform that action at this time.
0 commit comments