Commit a73178f 1 parent 00a1660 commit a73178f Copy full SHA for a73178f
File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ impl App {
177
177
178
178
/// Start a sync loop blocking the current thread
179
179
pub fn sync_loop ( & self , shutdown_rx : Option < mpsc:: Receiver < ( ) > > ) {
180
+ const RETRY_DUR : Duration = Duration :: from_secs ( 3 ) ;
181
+
180
182
let shutdown_rx = shutdown_rx
181
183
. map ( |rx| self . bind_shutdown ( rx) )
182
184
. or_else ( || self . default_shutdown_signal ( ) ) ;
@@ -189,18 +191,18 @@ impl App {
189
191
}
190
192
}
191
193
194
+ let mut wait_time = self . config . poll_interval ;
195
+
192
196
if let Err ( e) = self . sync ( ) {
193
- warn ! ( target: LT , "failed syncing with bitcoind: {:?}" , e) ;
194
197
// Report the error and try again on the next run, this might be
195
198
// a temporary connectivity issue.
199
+ warn ! ( target: LT , "failed syncing with bitcoind: {:?}" , e) ;
200
+ wait_time = RETRY_DUR ;
196
201
}
197
202
198
203
// wait for poll_interval seconds or until we receive a sync notification message
199
204
// (which can also get triggered through the shutdown signal)
200
- self . sync_chan
201
- . 1
202
- . recv_timeout ( self . config . poll_interval )
203
- . ok ( ) ;
205
+ self . sync_chan . 1 . recv_timeout ( wait_time) . ok ( ) ;
204
206
}
205
207
}
206
208
You can’t perform that action at this time.
0 commit comments