Commit 3ff29a16 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a97d8c11
...@@ -533,11 +533,11 @@ func (r *Root) zwatcher(ctx context.Context) (err error) { ...@@ -533,11 +533,11 @@ func (r *Root) zwatcher(ctx context.Context) (err error) {
defer xerr.Contextf(&err, "zwatch") // XXX more in context? defer xerr.Contextf(&err, "zwatch") // XXX more in context?
// XXX unmount on error? -> always EIO? // XXX unmount on error? -> always EIO?
zwatchq := make(chan zodb.WatchEvent) zwatchq := make(chan zodb.CommitEvent)
r.zstor.AddWatch(zwatchq) r.zstor.AddWatch(zwatchq)
defer r.zstor.DelWatch(zwatchq) defer r.zstor.DelWatch(zwatchq)
var zevent zodb.WatchEvent var zevent zodb.CommitEvent
var ok bool var ok bool
for { for {
...@@ -556,7 +556,7 @@ func (r *Root) zwatcher(ctx context.Context) (err error) { ...@@ -556,7 +556,7 @@ func (r *Root) zwatcher(ctx context.Context) (err error) {
} }
// zhandle1 handles 1 event from ZODB notification. // zhandle1 handles 1 event from ZODB notification.
func (r *Root) zhandle1(zevent zodb.WatchEvent) { func (r *Root) zhandle1(zevent zodb.CommitEvent) {
// while we are invalidating OS cache, make sure that nothing, that // while we are invalidating OS cache, make sure that nothing, that
// even reads /head/bigfile/*, is running (see 4.6). // even reads /head/bigfile/*, is running (see 4.6).
r.head.zconnMu.Lock() r.head.zconnMu.Lock()
...@@ -1167,7 +1167,11 @@ func main() { ...@@ -1167,7 +1167,11 @@ func main() {
// open zodb storage/db/connection // open zodb storage/db/connection
ctx := context.Background() // XXX + timeout? ctx := context.Background() // XXX + timeout?
zstor, err := zodb.OpenStorage(ctx, zurl, &zodb.OpenOptions{ReadOnly: true}) zstor, err := zodb.OpenStorage(ctx, zurl, &zodb.OpenOptions{
ReadOnly: true,
// FIXME zodb.Cache is not ready for watching and we don't use .Prefetch()
NoCache: true,
})
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment