@@ -342,7 +342,8 @@ macro_rules! define_run_body {
342
342
// falling back to our usual hourly prunes. This avoids short-lived clients never
343
343
// pruning their network graph. We run once 60 seconds after startup before
344
344
// continuing our normal cadence.
345
- if $timer_elapsed( & mut last_prune_call, if have_pruned { NETWORK_PRUNE_TIMER } else { FIRST_NETWORK_PRUNE_TIMER } ) {
345
+ let prune_timer = if have_pruned { NETWORK_PRUNE_TIMER } else { FIRST_NETWORK_PRUNE_TIMER } ;
346
+ if $timer_elapsed( & mut last_prune_call, prune_timer) {
346
347
// The network graph must not be pruned while rapid sync completion is pending
347
348
if let Some ( network_graph) = $gossip_sync. prunable_network_graph( ) {
348
349
#[ cfg( feature = "std" ) ] {
@@ -360,7 +361,8 @@ macro_rules! define_run_body {
360
361
361
362
have_pruned = true ;
362
363
}
363
- last_prune_call = $get_timer( NETWORK_PRUNE_TIMER ) ;
364
+ let prune_timer = if have_pruned { NETWORK_PRUNE_TIMER } else { FIRST_NETWORK_PRUNE_TIMER } ;
365
+ last_prune_call = $get_timer( prune_timer) ;
364
366
}
365
367
366
368
if $timer_elapsed( & mut last_scorer_persist_call, SCORER_PERSIST_TIMER ) {
@@ -867,7 +869,10 @@ mod tests {
867
869
868
870
if key == "network_graph" {
869
871
if let Some ( sender) = & self . graph_persistence_notifier {
870
- sender. send ( ( ) ) . unwrap ( ) ;
872
+ match sender. send ( ( ) ) {
873
+ Ok ( ( ) ) => { } ,
874
+ Err ( std:: sync:: mpsc:: SendError ( ( ) ) ) => println ! ( "Persister failed to notify as receiver went away." ) ,
875
+ }
871
876
} ;
872
877
873
878
if let Some ( ( error, message) ) = self . graph_error {
0 commit comments