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
04346414
Commit
04346414
authored
Mar 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
028fdbf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
go/zodb/storage.go
go/zodb/storage.go
+12
-3
No files found.
go/zodb/storage.go
View file @
04346414
...
@@ -151,7 +151,7 @@ type storage struct {
...
@@ -151,7 +151,7 @@ type storage struct {
l1cache
*
Cache
// can be =nil, if opened with NoCache
l1cache
*
Cache
// can be =nil, if opened with NoCache
down
chan
struct
{}
// ready when no longer operational
down
chan
struct
{}
// ready when no longer operational
downOnce
sync
.
Once
// shutdown may be due to both Close and IO error in watcher
downOnce
sync
.
Once
// shutdown may be due to both Close and IO error in watcher
|Sync
downErr
error
// reason for shutdown
downErr
error
// reason for shutdown
// watcher
// watcher
...
@@ -444,16 +444,25 @@ func (s *storage) Sync(ctx context.Context) (err error) {
...
@@ -444,16 +444,25 @@ func (s *storage) Sync(ctx context.Context) (err error) {
return
s
.
downErr
return
s
.
downErr
}
}
s
.
headMu
.
Lock
()
at
:=
s
.
head
s
.
headMu
.
Unlock
()
head
,
err
:=
s
.
driver
.
Sync
(
ctx
)
head
,
err
:=
s
.
driver
.
Sync
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
// XXX check that driver returns head↑
// check that driver returns head↑
if
!
(
head
>=
at
)
{
err
=
fmt
.
Errorf
(
"%s: storage error: sync not ↑= (%s -> %s)"
,
s
.
URL
(),
at
,
head
)
s
.
shutdown
(
err
)
return
err
}
// wait till .head >= head
// wait till .head >= head
watchq
:=
make
(
chan
Event
)
watchq
:=
make
(
chan
Event
)
at
:
=
s
.
AddWatch
(
watchq
)
at
=
s
.
AddWatch
(
watchq
)
defer
s
.
DelWatch
(
watchq
)
defer
s
.
DelWatch
(
watchq
)
for
at
<
head
{
for
at
<
head
{
...
...
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