Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
254cd177
Commit
254cd177
authored
Jun 12, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
eb78c5d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
wcfs/misc.go
wcfs/misc.go
+2
-0
wcfs/wcfs.go
wcfs/wcfs.go
+10
-3
No files found.
wcfs/misc.go
View file @
254cd177
...
...
@@ -631,6 +631,8 @@ func parseWatchFrame(line string) (stream uint64, msg string, err error) {
// parseWatch parses watch request wcfs received over /head/watch.
//
// watch <file> (@<at>|-)
//
// at="-" is returned as zodb.InvalidTid .
func
parseWatch
(
msg
string
)
(
oid
zodb
.
Oid
,
at
zodb
.
Tid
,
err
error
)
{
defer
func
()
{
if
err
!=
nil
{
...
...
wcfs/wcfs.go
View file @
254cd177
...
...
@@ -1382,8 +1382,6 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// XXX locking
// XXX at = zobd.InvalidTid - remove watch
// XXX if watch was already established - we need to update it
w
:=
wlink
.
byfile
[
foid
]
if
w
==
nil
{
...
...
@@ -1404,6 +1402,15 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
}
// at=InvalidTid means "remove the watch"
// XXX locking
if
at
==
zodb
.
InvalidTid
{
delete
(
wlink
.
byfile
,
foid
)
delete
(
w
.
file
.
watches
,
w
)
return
}
// XXX check at >= w.at -> reject?
if
!
(
at
>=
w
.
at
)
{
panic
(
"TODO"
)
...
...
@@ -1477,7 +1484,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
return
err
}
// XXX locking
// XXX locking
, place = ok? or move closer to at==zodb.InvalidTid ^^^?
wlink
.
byfile
[
foid
]
=
w
return
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment