Review round 2: a media restart no longer starts an app the household stopped (R-721); the file manager's header name file appears whole (R-1100 race, 44/300 -> 0/300); both red-proved; unreleased
gates / gates (push) Successful in 1m22s
gates / gates (push) Successful in 1m22s
This commit is contained in:
@@ -50,6 +50,19 @@ func (s *Server) mediaApps() []string {
|
||||
return s.stackMgr.MediaApps()
|
||||
}
|
||||
|
||||
// mediaAppsToRecreate is the list the media restart and the safe removal recreate: every media app except the ones the
|
||||
// household stopped (R-721) — a recreate would start them; their next start reads the override already written.
|
||||
func (s *Server) mediaAppsToRecreate(why string) []string {
|
||||
if s.stackMgr == nil {
|
||||
return nil
|
||||
}
|
||||
recreate, stopped := s.stackMgr.MediaAppsToRecreate()
|
||||
for _, name := range stopped {
|
||||
s.logger.Printf("[INFO] [media] %s: NOT recreating %s — the household stopped it; it sees the drives at its next start", why, name)
|
||||
}
|
||||
return recreate
|
||||
}
|
||||
|
||||
func (s *Server) presentMediaDrives() []mediawire.Drive {
|
||||
if s.stackMgr == nil {
|
||||
return nil
|
||||
@@ -195,7 +208,7 @@ func (s *Server) MediaNotice(checkStale bool) MediaDriveNotice {
|
||||
// recreates the file browser, records the restart on every drive, then wires the present drives in.
|
||||
func (s *Server) restartMediaApps(reason string) []string {
|
||||
var failed []string
|
||||
for _, name := range s.mediaApps() {
|
||||
for _, name := range s.mediaAppsToRecreate("restart (" + reason + ")") {
|
||||
if s.appHeld(name) {
|
||||
continue
|
||||
}
|
||||
@@ -304,7 +317,7 @@ func (s *Server) mediaSafeRemoval(path, durableID string) []string {
|
||||
if err := s.settings.SetEjected(path, durableID, paused); err != nil {
|
||||
s.logger.Printf("[WARN] [media] safe removal %s: recording it: %v", path, err)
|
||||
}
|
||||
for _, name := range s.mediaApps() {
|
||||
for _, name := range s.mediaAppsToRecreate("safe removal " + path) {
|
||||
if s.appHeld(name) {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user