M8 networkmanager: the folder's unknown is the module's
The folder the two parts share says unknown module, so the node-engine does nothing inside it and the watcher reacts: a path it does not know is left as it is and written to its journal once per path, at its start and at the file event that makes it; the README says so. Builds: design 08 sign-in-page §12, §24, §25, §27; lead answer L-1 (hq 3a3a18a9)
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"git.novox.be/novox/mesh-networking/modules/mesh-connectivity-contracts/go/seats/nodeuplink"
|
||||
@@ -148,6 +149,10 @@ type Watcher struct {
|
||||
// Beside runs an open beside the loop; the func it returns is run by the loop at its end.
|
||||
Beside func(work func() func())
|
||||
|
||||
// Made fires with each path a file event of the kernel makes in one of dirs, until stop closes.
|
||||
Made func(dirs []string, stop <-chan struct{}) <-chan string
|
||||
|
||||
told map[string]bool
|
||||
starting *sessionStart
|
||||
opening bool
|
||||
later []func()
|
||||
@@ -166,7 +171,7 @@ type Watcher struct {
|
||||
func newWatcher(f Folder) *Watcher {
|
||||
w := &Watcher{Folder: f, Dial: dialSystemBus, SocketThere: systemSocketThere, Now: time.Now, asks: make(chan asked),
|
||||
UID: uint32(os.Getuid()), Environment: userEnvironment, FileEvents: fileEvents, After: time.After,
|
||||
Desk: newSessionDesk(), ends: make(chan func())}
|
||||
Desk: newSessionDesk(), ends: make(chan func()), Made: pathsMade}
|
||||
w.Beside = w.besideLoop
|
||||
return w
|
||||
}
|
||||
@@ -206,6 +211,13 @@ func (w *Watcher) run(stop <-chan struct{}) {
|
||||
if w.asks == nil {
|
||||
w.asks = make(chan asked)
|
||||
}
|
||||
var made <-chan string
|
||||
if w.Made != nil {
|
||||
made = w.Made([]string{w.Folder.Dir, filepath.Join(w.Folder.Dir, pendingName)}, stop)
|
||||
}
|
||||
for _, p := range w.Folder.unknownAtStart() {
|
||||
w.strange(p)
|
||||
}
|
||||
w.subscribe()
|
||||
for {
|
||||
select {
|
||||
@@ -227,6 +239,8 @@ func (w *Watcher) run(stop <-chan struct{}) {
|
||||
case <-w.socketAt:
|
||||
w.socketAt = nil
|
||||
w.subscribe()
|
||||
case p := <-made:
|
||||
w.strange(p)
|
||||
case end := <-w.ends:
|
||||
end()
|
||||
case a := <-w.asks:
|
||||
|
||||
Reference in New Issue
Block a user