mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-25 23:21:54 +08:00
fsrepo: Detect uninitialized repo by missing config file
Earlier, it also checked checked the leveldb directory. That part added no crash safety to the application, and just hardcoded assumptions about the datastore. If anything, this should rely on the absolute last item created by fsrepo.Init, and there should be fsync guarantees about ordering. License: MIT Signed-off-by: Tommi Virtanen <tv@eagain.net>
This commit is contained in:
@ -622,8 +622,10 @@ func isInitializedUnsynced(repoPath string) bool {
|
||||
if !configIsInitialized(repoPath) {
|
||||
return false
|
||||
}
|
||||
|
||||
if !util.FileExists(filepath.Join(repoPath, leveldbDirectory)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user