-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding Unwatch function for file provider #245
adding Unwatch function for file provider #245
Conversation
@rhnvrm , I have made the following changes:
|
@prateek-narsinghani thanks for the PR. Could you please add tests for this as well? |
@knadh I have added a test for the Unwatch function. Let me know if any further changes are required. |
65ec25c
to
3b8a879
Compare
0bc0e3e
to
91c6bac
Compare
91c6bac
to
6dc3b80
Compare
// Unwatch stops watching the files. It closes all the fsnotify watchers | ||
// and event channels associated with them. | ||
func (f *File) Unwatch() error { | ||
return f.w.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f.w = nil
is missing here for the case of restart watching (there is checking for f.w != nil
os.WriteFile(tmpFile, []byte(`{"parent": {"name": "name2"}}`), 0600) | ||
wg.Wait() | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the sequence of Watch/Unwatch/Watch needs to be checked
I finally got around to looking into this. Please take a look at: #306 It addresses a couple of issues in this PR:
|
No description provided.