Add a storage prefix flat:// that can handle a flat chunk directory

This commit is contained in:
Gilbert Chen
2017-07-27 22:42:48 -04:00
parent caaff6b4b2
commit 823b82060c
6 changed files with 33 additions and 19 deletions

View File

@@ -144,7 +144,16 @@ func CreateStorage(preference Preference, resetPassword bool, threads int) (stor
}
if isFileStorage {
fileStorage, err := CreateFileStorage(storageURL, threads)
fileStorage, err := CreateFileStorage(storageURL, 2, threads)
if err != nil {
LOG_ERROR("STORAGE_CREATE", "Failed to load the file storage at %s: %v", storageURL, err)
return nil
}
return fileStorage
}
if strings.HasPrefix(storageURL, "flat://") {
fileStorage, err := CreateFileStorage(storageURL, 0, threads)
if err != nil {
LOG_ERROR("STORAGE_CREATE", "Failed to load the file storage at %s: %v", storageURL, err)
return nil