Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
5cb8d80b
Commit
5cb8d80b
authored
10 years ago
by
Tommi Virtanen
Committed by
Juan Batiz-Benet
9 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LevelDB is no longer "the" datastore, adjust identifiers
parent
7eb4a92a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
repo/fsrepo/fsrepo.go
repo/fsrepo/fsrepo.go
+6
-6
No files found.
repo/fsrepo/fsrepo.go
View file @
5cb8d80b
...
...
@@ -25,7 +25,7 @@ import (
)
const
(
defaultDataStore
Directory
=
"datastore"
leveldb
Directory
=
"datastore"
)
var
(
...
...
@@ -190,8 +190,8 @@ func Init(repoPath string, conf *config.Config) error {
// The actual datastore contents are initialized lazily when Opened.
// During Init, we merely check that the directory is writeable.
p
:=
path
.
Join
(
repoPath
,
defaultDataStore
Directory
)
if
err
:=
dir
.
Writable
(
p
);
err
!=
nil
{
leveldbPath
:=
path
.
Join
(
repoPath
,
leveldb
Directory
)
if
err
:=
dir
.
Writable
(
leveldbPath
);
err
!=
nil
{
return
fmt
.
Errorf
(
"datastore: %s"
,
err
)
}
...
...
@@ -236,8 +236,8 @@ func (r *FSRepo) openConfig() error {
// openDatastore returns an error if the config file is not present.
func
(
r
*
FSRepo
)
openDatastore
()
error
{
ds
Path
:=
path
.
Join
(
r
.
path
,
defaultDataStore
Directory
)
ds
,
err
:=
levelds
.
NewDatastore
(
ds
Path
,
&
levelds
.
Options
{
leveldb
Path
:=
path
.
Join
(
r
.
path
,
leveldb
Directory
)
ds
,
err
:=
levelds
.
NewDatastore
(
leveldb
Path
,
&
levelds
.
Options
{
Compression
:
ldbopts
.
NoCompression
,
})
if
err
!=
nil
{
...
...
@@ -430,7 +430,7 @@ func isInitializedUnsynced(repoPath string) bool {
if
!
configIsInitialized
(
repoPath
)
{
return
false
}
if
!
util
.
FileExists
(
path
.
Join
(
repoPath
,
defaultDataStore
Directory
))
{
if
!
util
.
FileExists
(
path
.
Join
(
repoPath
,
leveldb
Directory
))
{
return
false
}
return
true
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment