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
04346414
Commit
04346414
authored
Mar 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
028fdbf0
Changes
1
Show 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 {
l1cache
*
Cache
// can be =nil, if opened with NoCache
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
// watcher
...
...
@@ -444,16 +444,25 @@ func (s *storage) Sync(ctx context.Context) (err error) {
return
s
.
downErr
}
s
.
headMu
.
Lock
()
at
:=
s
.
head
s
.
headMu
.
Unlock
()
head
,
err
:=
s
.
driver
.
Sync
(
ctx
)
if
err
!=
nil
{
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
watchq
:=
make
(
chan
Event
)
at
:
=
s
.
AddWatch
(
watchq
)
at
=
s
.
AddWatch
(
watchq
)
defer
s
.
DelWatch
(
watchq
)
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