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

.

parent edfe3e4c
......@@ -472,25 +472,25 @@ func (fs *FileStorage) _watcher(w *fsnotify.Watcher) (err error) {
mainloop:
for {
if !first {
tracef("select ...")
//tracef("select ...")
select {
// XXX handle close
case err := <-w.Errors:
tracef("error: %s", err)
//tracef("error: %s", err)
if err != fsnotify.ErrEventOverflow {
return err
}
// events lost, but it is safe since we are always rechecking file size
case e := <-w.Events:
case <-w.Events:
// we got some kind of "file was modified" event (e.g.
// write, truncate, chown ...) -> it is time to check the file again.
tracef("event: %s", e)
//tracef("event: %s", e)
case <-tick.C:
// recheck the file periodically.
tracef("tick")
//tracef("tick")
}
}
first = false
......@@ -512,7 +512,7 @@ mainloop:
// there is some data after toppos - try to advance as much as we can.
// start iterating afresh with empty buffer.
tracef("scanning ...")
//tracef("scanning ...")
it := Iterate(seqReadAt(f), idx.TopPos, IterForward)
for {
err = it.NextTxn(LoadNoStrings)
......
......@@ -348,6 +348,7 @@ func BenchmarkIterate(b *testing.B) {
b.StopTimer()
}
// XXX kill
var tracef = func(format string, argv ...interface{}) {
log.Printf("W " + format, argv...)
}
......@@ -405,7 +406,7 @@ func TestWatch(t *testing.T) {
}
xcommit := func(at zodb.Tid, objv ...Object) zodb.Tid {
tracef("\n\n-> xcommit %s", at)
tracef("-> xcommit %s", at)
defer tracef("<- xcommit")
t.Helper()
tid, err := zcommit(at, objv...)
......@@ -444,7 +445,7 @@ func TestWatch(t *testing.T) {
// run py `zodb commit`.
//
// if one day it is either fixed, or worked around, we could ↑ 10 to 100.
for i := zodb.Oid(0); i < 10; i++ {
for i := zodb.Oid(1); i <= 10; i++ {
at = xcommit(at,
Object{0, fmt.Sprintf("data0.%d", i)},
Object{i, fmt.Sprintf("data%d", i)})
......
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