webapp: When creating a repository on a removable drive, set core.fsyncobjectfiles, to help prevent data loss when the drive is yanked.
This commit is contained in:
parent
381637e4c8
commit
5c82c99c76
2 changed files with 6 additions and 0 deletions
|
@ -268,6 +268,10 @@ getFinishAddDriveR drive = make >>= redirect . EditNewRepositoryR
|
|||
liftIO $ createDirectoryIfMissing True dir
|
||||
isnew <- liftIO $ makeRepo dir True
|
||||
u <- liftIO $ initRepo isnew False dir $ Just remotename
|
||||
{- Removable drives are not reliable media, so enable fsync. -}
|
||||
liftIO $ inDir dir $
|
||||
setConfig (ConfigKey "core.fsyncobjectfiles")
|
||||
(boolConfig True)
|
||||
r <- combineRepos dir remotename
|
||||
liftAnnex $ setStandardGroup u TransferGroup
|
||||
liftAssistant $ syncRemote r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue