openAndSetUpSQLCipher: Enable checkpoint_fullfsync pragma
This commit is contained in:
		
					parent
					
						
							
								f23f86d0e2
							
						
					
				
			
			
				commit
				
					
						c97c440b3f
					
				
			
		
					 1 changed files with 13 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -700,6 +700,19 @@ function openAndSetUpSQLCipher(
 | 
			
		|||
    throw error;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  try {
 | 
			
		||||
    // fullfsync is only supported on macOS
 | 
			
		||||
    db.pragma('fullfsync = false');
 | 
			
		||||
 | 
			
		||||
    // a lower-impact approach, if fullfsync is too impactful
 | 
			
		||||
    db.pragma('checkpoint_fullfsync = true');
 | 
			
		||||
  } catch (error) {
 | 
			
		||||
    logger.warn(
 | 
			
		||||
      'openAndSetUpSQLCipher: Unable to set fullfsync',
 | 
			
		||||
      Errors.toLogFormat(error)
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return db;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue