File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
aggregation_mode/src/backend Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -142,13 +142,12 @@ impl ProofAggregator {
142142 ) ;
143143
144144 // Iterate until we can send the proof on-chain
145- let start_time = Instant :: now ( ) ;
145+ let mut time_elapsed: Duration =
146+ Instant :: now ( ) . duration_since ( start_time) + Duration :: from_secs ( 24 * 3600 ) ;
146147
147148 loop {
148149 // We add 24 hours because the proof aggregator runs once a day, so the time elapsed
149150 // should be considered over a 24h period.
150- let time_elapsed: Duration =
151- Instant :: now ( ) . duration_since ( start_time) + Duration :: from_secs ( 24 * 3600 ) ;
152151
153152 let gas_price = self . fetcher . get_gas_price ( ) . await . map_err ( FetchingProofs ) ?;
154153
@@ -172,7 +171,9 @@ impl ProofAggregator {
172171 }
173172
174173 // Sleep for 3 minutes (15 blocks) before re-evaluating
175- sleep ( Duration :: from_secs ( 180 ) ) ;
174+ let time_to_sleep = Duration :: from_secs ( 180 ) ;
175+ time_elapsed += time_to_sleep;
176+ sleep ( time_to_sleep) ;
176177 }
177178
178179 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments