File tree Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -4915,19 +4915,11 @@ pub unsafe extern "C" fn dc_accounts_background_fetch(
4915
4915
let accounts = & * accounts;
4916
4916
block_on ( async move {
4917
4917
let accounts = accounts. read ( ) . await ;
4918
- match accounts
4918
+ accounts
4919
4919
. background_fetch ( Duration :: from_secs ( timeout_in_seconds) )
4920
- . await
4921
- {
4922
- Ok ( ( ) ) => 1 ,
4923
- Err ( err) => {
4924
- accounts. emit_event ( EventType :: Error ( format ! (
4925
- "Failed to do background fetch: {err:#}"
4926
- ) ) ) ;
4927
- 0
4928
- }
4929
- }
4930
- } )
4920
+ . await ;
4921
+ } ) ;
4922
+ 1
4931
4923
}
4932
4924
4933
4925
#[ no_mangle]
Original file line number Diff line number Diff line change @@ -233,16 +233,15 @@ impl CommandApi {
233
233
234
234
/// Performs a background fetch for all accounts in parallel with a timeout.
235
235
///
236
- /// The `AccountsBackgroundFetchDone` event is emitted at the end
237
- /// if the method returns sucessfully, even in case of timeout.
236
+ /// The `AccountsBackgroundFetchDone` event is emitted at the end even in case of timeout.
238
237
/// Process all events until you get this one and you can safely return to the background
239
238
/// without forgetting to create notifications caused by timing race conditions.
240
239
async fn accounts_background_fetch ( & self , timeout_in_seconds : f64 ) -> Result < ( ) > {
241
240
self . accounts
242
241
. write ( )
243
242
. await
244
243
. background_fetch ( std:: time:: Duration :: from_secs_f64 ( timeout_in_seconds) )
245
- . await ? ;
244
+ . await ;
246
245
Ok ( ( ) )
247
246
}
248
247
Original file line number Diff line number Diff line change @@ -317,9 +317,7 @@ impl Accounts {
317
317
/// The `AccountsBackgroundFetchDone` event is emitted at the end,
318
318
/// process all events until you get this one and you can safely return to the background
319
319
/// without forgetting to create notifications caused by timing race conditions.
320
- ///
321
- /// On error no `AccountsBackgroundFetchDone` event is emitted.
322
- pub async fn background_fetch ( & self , timeout : std:: time:: Duration ) -> Result < ( ) > {
320
+ pub async fn background_fetch ( & self , timeout : std:: time:: Duration ) {
323
321
if let Err ( _err) =
324
322
tokio:: time:: timeout ( timeout, self . background_fetch_without_timeout ( ) ) . await
325
323
{
@@ -328,7 +326,6 @@ impl Accounts {
328
326
) ) ;
329
327
}
330
328
self . emit_event ( EventType :: AccountsBackgroundFetchDone ) ;
331
- Ok ( ( ) )
332
329
}
333
330
334
331
/// Emits a single event.
You can’t perform that action at this time.
0 commit comments