1
0
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:
Tommi Virtanen
2015-05-19 16:05:57 -07:00
committed by Jeromy
parent 6996ce6758
commit dc73744082

View File

@ -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
}