Fix storage service failed to start after restarting it (#352)
This commit is contained in:
committed by
Soam Vasani
parent
e56e6482b3
commit
42819ba362
@@ -24,6 +24,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/gorilla/handlers"
|
"github.com/gorilla/handlers"
|
||||||
@@ -201,6 +202,10 @@ func MakeStorageService(sc *storageConfig) (*StorageService, error) {
|
|||||||
ss.location = loc
|
ss.location = loc
|
||||||
|
|
||||||
con, err := loc.CreateContainer(sc.containerName)
|
con, err := loc.CreateContainer(sc.containerName)
|
||||||
|
if os.IsExist(err) {
|
||||||
|
id := filepath.Join(sc.localPath, sc.containerName)
|
||||||
|
con, err = loc.Container(id)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error initializing storage: %v", err)
|
log.Printf("Error initializing storage: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user