Commit ce0bb4f8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5fc83902
......@@ -176,6 +176,9 @@ func (d *Storage) Sync(ctx context.Context) (_ zodb.Tid, err error) {
err = &zodb.OpError{URL: d.URL(), Op: "sync", Err: err}
}
}()
if ready(d.down) {
return zodb.InvalidTid, d.downErr
}
var head zodb.Tid
wg := xsync.NewWorkGroup(ctx)
......@@ -215,7 +218,6 @@ func (d *Storage) Load(ctx context.Context, xid zodb.Xid) (_ *mem.Buf, _ zodb.Ti
err = &zodb.OpError{URL: d.URL(), Op: "load", Args: xid, Err: err}
}
}()
if ready(d.down) {
return nil, zodb.InvalidTid, d.downErr
}
......@@ -397,7 +399,7 @@ func init() {
}
// misc
// ---- misc ----
// ready returns whether c is ready.
func ready(c <-chan struct{}) bool {
......
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