File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
mithril-aggregator/src/services Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1- use std:: sync:: Arc ;
1+ use std:: { sync:: Arc , time :: Duration } ;
22
33use slog:: { Logger , error, warn} ;
44
@@ -34,6 +34,8 @@ pub struct SequentialSignatureProcessor {
3434}
3535
3636impl SequentialSignatureProcessor {
37+ const ERROR_DELAY_IN_SECONDS : Duration = Duration :: from_secs ( 1 ) ;
38+
3739 /// Creates a new `SignatureProcessor` instance.
3840 pub fn new (
3941 consumer : Arc < dyn SignatureConsumer > ,
@@ -100,7 +102,16 @@ impl SignatureProcessor for SequentialSignatureProcessor {
100102
101103 return Ok ( ( ) ) ;
102104 }
103- _ = self . process_signatures( ) => { }
105+ res = self . process_signatures( ) => {
106+ match res {
107+ Err ( e) => {
108+ error!( self . logger, "Error processing signatures" ; "error" => ?e) ;
109+ error!( self . logger, "Sleep for {} seconds" , Self :: ERROR_DELAY_IN_SECONDS . as_secs( ) ) ;
110+ tokio:: time:: sleep( Self :: ERROR_DELAY_IN_SECONDS ) . await ;
111+ }
112+ _ => { }
113+ }
114+ }
104115 }
105116 }
106117 }
You can’t perform that action at this time.
0 commit comments