File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
database_upgrader/src/upgrader Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ pub async fn append_audit_events(events: &[AuditEvent]) -> Result<()> {
46
46
provider. append_audit_events ( events) . await ?;
47
47
}
48
48
}
49
+
50
+ // For test specs we don't require an audit trail
49
51
#[ cfg( debug_assertions) ]
50
52
{
51
53
if let Some ( providers) = providers ( ) {
Original file line number Diff line number Diff line change @@ -330,14 +330,19 @@ impl Paths {
330
330
/// account-level preferences.
331
331
pub fn preferences_file ( & self ) -> PathBuf {
332
332
let mut path = if self . is_global ( ) {
333
- self . documents_dir ( ) . join ( PREFERENCES_FILE )
333
+ self . global_preferences_file ( )
334
334
} else {
335
335
self . user_dir ( ) . join ( PREFERENCES_FILE )
336
336
} ;
337
337
path. set_extension ( JSON_EXT ) ;
338
338
path
339
339
}
340
340
341
+ /// Path to the global preferences file.
342
+ pub fn global_preferences_file ( & self ) -> PathBuf {
343
+ self . documents_dir ( ) . join ( PREFERENCES_FILE )
344
+ }
345
+
341
346
/// Path to the file used to store account-level system messages.
342
347
///
343
348
/// # Panics
Original file line number Diff line number Diff line change @@ -435,6 +435,7 @@ async fn delete_stale_files(
435
435
let mut files = vec ! [
436
436
options. paths. identity_dir( ) . to_owned( ) ,
437
437
options. paths. audit_file( ) . to_owned( ) ,
438
+ options. paths. global_preferences_file( ) . to_owned( ) ,
438
439
] ;
439
440
440
441
for account in accounts {
@@ -461,5 +462,12 @@ async fn delete_stale_files(
461
462
}
462
463
}
463
464
465
+ // Can error if the local directory is not empty!
466
+ if let Err ( error) = vfs:: remove_dir ( options. paths . local_dir ( ) ) . await {
467
+ tracing:: error!(
468
+ error = %error,
469
+ "updgrade_accounts::remove_local_dir" ) ;
470
+ }
471
+
464
472
Ok ( files)
465
473
}
You can’t perform that action at this time.
0 commit comments