Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
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
Show 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