Commits: |
|
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+78 -2) |
Use fsnotify to refresh hgweb
Review Request #2412 — Created March 31, 2023 and discarded
Information | |
---|---|
aklitzing@gmail.com | |
grim/hgkeeper | |
default | |
HGKEEPER-25 | |
Reviewers | |
grim |
If a repository got renamed or removed hgweb was not updated and
show the old repository in the index. Also the new repo path
was not added.So let's add a watcher to refreshes it immediately.
Summary | Author | |
---|---|---|
Andre Klitzing |
Description | From | Last Updated |
---|---|---|
I will try something else... so lets wait here. :-) |
|
|
you can drop waitForEvent and just use a break on line 24. |
|
|
This code assumes that the go routine for previous watcher has finished. I'm not very familar with the fsnotify package, … |
|
|
Maybe we should add the parent directory only if not already watched. Otherwise we will watch all content in that … |
|
Commits: |
|
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+78 -2) |
Summary: |
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||
Commits: |
|
||||||||||||||||||||||||||||||||||||
Diff: |
Revision 4 (+72) |
Description: |
|
---|
-
-
access/hgweb.go (Diff revision 4) Maybe we should add the parent directory only if not already watched. Otherwise we will watch all content in that directory, too. That would be nice in hgkeeper working directory. But
Refresh()
hgkeeper repo stuff if another repository has an updated working-directory is strange.Maybe you want to change this a little bit. :-)
Change Summary:
meta data tweaks
Description: |
|
|||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Bugs: |
|
-
-
-
access/hgweb.go (Diff revision 4) This code assumes that the go routine for previous watcher has finished. I'm not very familar with the
fsnotify
package, but I'm also worried we're going to trigger this a lot.For example, a push to the admin repo is going create multiple file system events, which, if I'm not mistaken, is going to run the refresh multiple times when it really just needs to be once during that push.
Maybe we need to cancel the
fsnotify.Watcher
while we're getting an admin repo update?That wouldn't cover the case where someone renames a repository and a bunch of files change though. So maybe we need a way to manually add stop and create the watcher, so that we can better control it.
For example, during admin repo push, stop the watcher, handle the push, and then
access.Refresh
and tell it to create thefsnotify.Watcher
.Likewise, the
fsnotify.Watcher
should ignore additional events for some duration of time, or not create itself until the queue of events is gone?Actually do we need to recreate this each time? If we can just have a single instance and tell it to ignore events for a bit, that seems like the best case.
Summary: |
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commits: |
|
||||||||||||
Diff: |
Revision 5 (+86) |
Description: |
|
---|
Commits: |
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 6 (+96) |