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) {
defer xerr.Contextf(&err, "zwatch") // XXX more in context?
// XXX unmount on error? -> always EIO?
zwatchq := make(chan zodb.WatchEvent)
zwatchq := make(chan zodb.CommitEvent)
r.zstor.AddWatch(zwatchq)
defer r.zstor.DelWatch(zwatchq)
var zevent zodb.WatchEvent
var zevent zodb.CommitEvent
var ok bool
for {
......@@ -556,7 +556,7 @@ func (r *Root) zwatcher(ctx context.Context) (err error) {
}
// 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
// even reads /head/bigfile/*, is running (see 4.6).
r.head.zconnMu.Lock()
......@@ -1167,7 +1167,11 @@ func main() {
// open zodb storage/db/connection
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 {
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