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
01b24b1e
Commit
01b24b1e
authored
Mar 17, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
351d5dfa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
go/zodb/storage/demo/demo.go
go/zodb/storage/demo/demo.go
+8
-9
No files found.
go/zodb/storage/demo/demo.go
View file @
01b24b1e
...
@@ -19,15 +19,10 @@
...
@@ -19,15 +19,10 @@
// Package demo provides overlayed storage, similar to DemoStorage in ZODB/py.
// Package demo provides overlayed storage, similar to DemoStorage in ZODB/py.
//
//
// Storage combines base and δ storages as if δ transactional log
wa
s logically
// Storage combines base and δ storages as if δ transactional log
i
s logically
// appended to base.
// appended to base.
//
// XXX
// XXX link to DemoStorage
package
demo
package
demo
// TODO tests
import
(
import
(
"context"
"context"
"errors"
"errors"
...
@@ -52,8 +47,12 @@ type Storage struct {
...
@@ -52,8 +47,12 @@ type Storage struct {
// Close implements zodb.IStorageDriver .
// Close implements zodb.IStorageDriver .
func
(
d
*
Storage
)
Close
()
error
{
func
(
d
*
Storage
)
Close
()
(
err
error
)
{
// XXX errctx?
defer
func
()
{
if
err
!=
nil
{
err
=
&
zodb
.
OpError
{
URL
:
d
.
URL
(),
Op
:
"close"
,
Err
:
err
}
}
}()
err1
:=
d
.
δ
.
Close
()
err1
:=
d
.
δ
.
Close
()
err2
:=
d
.
base
.
Close
()
err2
:=
d
.
base
.
Close
()
...
@@ -65,7 +64,7 @@ func (d *Storage) Close() error {
...
@@ -65,7 +64,7 @@ func (d *Storage) Close() error {
func
(
d
*
Storage
)
Sync
(
ctx
context
.
Context
)
(
head
zodb
.
Tid
,
err
error
)
{
func
(
d
*
Storage
)
Sync
(
ctx
context
.
Context
)
(
head
zodb
.
Tid
,
err
error
)
{
defer
func
()
{
defer
func
()
{
if
err
!=
nil
{
if
err
!=
nil
{
err
=
&
zodb
.
OpError
{
URL
:
d
.
URL
(),
Op
:
"sync"
,
Args
:
xid
,
Err
:
err
}
err
=
&
zodb
.
OpError
{
URL
:
d
.
URL
(),
Op
:
"sync"
,
Err
:
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