Commit 16f5dcaa authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ca77282e
......@@ -640,7 +640,7 @@ class tFile:
if t.at is None: # @head/...
for wlink in t.tdb._wlinks:
pinok = {}
w = wlink._watching.get(t.zf)
w = wlink._watching.get(t.zf._p_oid)
if w is not None and w.at < blkrev:
if cached == 1:
# @head[blk].rev is after w.at - w[blk] must be already pinned
......@@ -785,7 +785,7 @@ class tWatchLink:
t._serveWG.go(t._serveRX)
# this tWatchLink currently watches the following files at particular state.
t._watching = {} # {} ZBigFile -> tWatch XXX ZBigFile -> foid
t._watching = {} # {} foid -> tWatch
tdb._wlinks.add(t)
......@@ -1002,10 +1002,11 @@ class tSrvReq:
# pinok when it is present.
@func(tWatchLink)
def watch(twlink, zf, at, pinok=None): # -> tWatch
foid = zf._p_oid
t = twlink.tdb
w = twlink._watching.get(zf)
w = twlink._watching.get(foid)
if w is None:
w = twlink._watching[zf] = tWatch(zf._p_oid)
w = twlink._watching[foid] = tWatch(foid)
at_prev = None
else:
at_prev = w.at # we were previously watching zf @at_prev
......@@ -1013,7 +1014,7 @@ def watch(twlink, zf, at, pinok=None): # -> tWatch
at_from = ''
if at_prev is not None:
at_from = '(%s ->) ' % at_prev
print('\nC: setup watch f<%s> %s%s' % (h(zf._p_oid), at_from, at))
print('\nC: setup watch f<%s> %s%s' % (h(foid), at_from, at))
accessed = t._blkaccessed(zf)
lastRevOf = lambda blk: t._blkRevAt(zf, blk, t.head)
......@@ -1088,8 +1089,9 @@ def watch(twlink, zf, at, pinok=None): # -> tWatch
# stop_watch instructs wlink to stop watching the file.
@func(tWatchLink)
def stop_watch(twlink, zf):
assert zf in twlink._watching
w = twlink._watching.pop(zf)
foid = zf._p_oid
assert foid in twlink._watching
w = twlink._watching.pop(foid)
twlink._watch(zf, b"-", {}, "ok")
w.at = z64
......@@ -1142,7 +1144,7 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
for wlink, (zf, pinok) in pinokByWLink.items():
def _(ctx, wlink, zf, pinok):
w = wlink._watching.get(zf)
w = wlink._watching.get(zf._p_oid)
if len(pinok) > 0:
assert w is not None
......
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