Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
6db32a78
Commit
6db32a78
authored
Oct 15, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2b8a5115
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
go/zodb/db.go
go/zodb/db.go
+19
-11
No files found.
go/zodb/db.go
View file @
6db32a78
...
...
@@ -24,7 +24,6 @@ package zodb
import
(
"context"
"fmt"
"sort"
"sync"
"time"
...
...
@@ -75,6 +74,23 @@ type ConnOptions struct {
NoSync
bool
// don't sync with storage to get its last tid.
}
// XXX place=?
func
(
opt
*
ConnOptions
)
String
()
string
{
s
:=
"(@"
if
opt
.
At
!=
0
{
s
+=
opt
.
At
.
String
()
}
else
{
s
+=
"head"
}
s
+=
", "
if
opt
.
NoSync
{
s
+=
"no"
}
s
+=
"sync)"
return
s
}
// Open opens new connection to the database.
//
// By default the connection is opened to current latest database state; opt.At
...
...
@@ -89,18 +105,10 @@ func (db *DB) Open(ctx context.Context, opt *ConnOptions) (_ *Connection, err er
return
}
var
argv
[]
interface
{}
if
opt
.
At
!=
0
{
argv
=
append
(
argv
,
fmt
.
Sprintf
(
"at=%s"
,
opt
.
At
))
}
if
opt
.
NoSync
{
argv
=
append
(
argv
,
"nosync"
)
}
err
=
&
OpError
{
URL
:
db
.
stor
.
URL
(),
Op
:
"open db"
,
Args
:
argv
,
Args
:
opt
,
Err
:
err
,
}
}()
...
...
@@ -158,7 +166,7 @@ func (db *DB) get(at Tid) *Connection {
})
// search through window of X previous connections and find out the one
// with minimal distance to get to state @at. If all connections are to
// with minimal distance to get to state @at. If all connections are to
o
// distant - create connection anew.
//
// XXX search not only previous, but future too? (we can get back to
...
...
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