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
c64268eb
Commit
c64268eb
authored
Mar 17, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
abcec3cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
go/zodb/storage/demo/demo.go
go/zodb/storage/demo/demo.go
+16
-2
No files found.
go/zodb/storage/demo/demo.go
View file @
c64268eb
...
...
@@ -33,6 +33,7 @@ import (
"lab.nexedi.com/kirr/go123/mem"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xsync"
"lab.nexedi.com/kirr/neo/go/internal/task"
"lab.nexedi.com/kirr/neo/go/zodb"
)
...
...
@@ -61,14 +62,27 @@ func (d *Storage) Close() (err error) {
}
// Sync implements zodb.IStorageDriver .
func
(
d
*
Storage
)
Sync
(
ctx
context
.
Context
)
(
head
zodb
.
Tid
,
err
error
)
{
func
(
d
*
Storage
)
Sync
(
ctx
context
.
Context
)
(
_
zodb
.
Tid
,
err
error
)
{
defer
func
()
{
if
err
!=
nil
{
err
=
&
zodb
.
OpError
{
URL
:
d
.
URL
(),
Op
:
"sync"
,
Err
:
err
}
}
}()
head
,
err
=
d
.
δ
.
Sync
(
ctx
)
var
head
zodb
.
Tid
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
h
,
err
:=
d
.
δ
.
Sync
(
ctx
)
head
=
h
return
err
})
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
baseHead
,
err
:=
d
.
base
.
Sync
(
ctx
)
// XXX baseHead != .baseAt0 -> fail
return
err
})
err
=
wg
.
Wait
()
if
err
!=
nil
{
return
zodb
.
InvalidTid
,
err
}
...
...
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